summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authorsr55 <[email protected]>2017-04-10 16:37:23 +0100
committersr55 <[email protected]>2017-04-10 16:37:23 +0100
commit10e88ed33ce9a397e92aed8d03631bed3014f8b9 (patch)
treec97dfbf4b104fde2e35ef11010feed6d912aa5cd /win
parent43b9078916d7f12fd853e28e9574f93fb24e68d9 (diff)
WinGui: Audio Defaults: If the mixdown is not supported, get the best default mixdown for the source track / encoder. #661
Diffstat (limited to 'win')
-rw-r--r--win/CS/HandBrakeWPF/Services/Encode/Model/Models/AudioTrack.cs11
1 files changed, 11 insertions, 0 deletions
diff --git a/win/CS/HandBrakeWPF/Services/Encode/Model/Models/AudioTrack.cs b/win/CS/HandBrakeWPF/Services/Encode/Model/Models/AudioTrack.cs
index 6dede959d..5d0333311 100644
--- a/win/CS/HandBrakeWPF/Services/Encode/Model/Models/AudioTrack.cs
+++ b/win/CS/HandBrakeWPF/Services/Encode/Model/Models/AudioTrack.cs
@@ -123,6 +123,17 @@ namespace HandBrakeWPF.Services.Encode.Model.Models
this.encoder = chosenEncoder;
this.gain = track.Gain;
this.mixDown = track.MixDown != null ? track.MixDown.ShortName : "dpl2";
+
+ // If the mixdown isn't supported, downgrade it.
+ if (!HandBrakeEncoderHelpers.MixdownIsSupported(track.MixDown, encoderInfo, sourceTrack.ChannelLayout))
+ {
+ HBMixdown changedMixdown = HandBrakeEncoderHelpers.GetDefaultMixdown(encoderInfo, (ulong)sourceTrack.ChannelLayout);
+ if (changedMixdown != null)
+ {
+ this.mixDown = changedMixdown.ShortName;
+ }
+ }
+
this.sampleRate = track.SampleRate;
this.encoderRateType = track.EncoderRateType;
this.quality = track.Quality;