summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrake.ApplicationServices
diff options
context:
space:
mode:
authorsr55 <[email protected]>2016-04-12 19:04:11 +0100
committersr55 <[email protected]>2016-04-12 19:04:11 +0100
commit8be786a08e1368e7420a13b6f8ca99e560f287ff (patch)
treef9e95f0fd3d314a6138951f970134aa4c229fd42 /win/CS/HandBrake.ApplicationServices
parent697553a2f127e8c76d4dbf94fef91d81480869a4 (diff)
WinGui: Handle null mixdowns properly. Fixes #152
Diffstat (limited to 'win/CS/HandBrake.ApplicationServices')
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/HandBrakeEncoderHelpers.cs6
1 files changed, 5 insertions, 1 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeEncoderHelpers.cs b/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeEncoderHelpers.cs
index 9de57c2be..e4312e451 100644
--- a/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeEncoderHelpers.cs
+++ b/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeEncoderHelpers.cs
@@ -459,7 +459,11 @@ namespace HandBrake.ApplicationServices.Interop
public static HBMixdown SanitizeMixdown(HBMixdown mixdown, HBAudioEncoder encoder, ulong layout)
{
int sanitizedMixdown = HBFunctions.hb_mixdown_get_best((uint)encoder.Id, layout, mixdown.Id);
- return Mixdowns.Single(m => m.Id == sanitizedMixdown);
+ if (sanitizedMixdown != -1)
+ {
+ return Mixdowns.Single(m => m.Id == sanitizedMixdown);
+ }
+ return Mixdowns.FirstOrDefault(); // "none"
}
/// <summary>