]> granicus.if.org Git - handbrake/commitdiff
WinGui: Audio Defaults: If the mixdown is not supported, get the best default mixdo...
authorsr55 <sr55.hb@outlook.com>
Mon, 10 Apr 2017 15:37:23 +0000 (16:37 +0100)
committersr55 <sr55.hb@outlook.com>
Mon, 10 Apr 2017 15:37:23 +0000 (16:37 +0100)
win/CS/HandBrakeWPF/Services/Encode/Model/Models/AudioTrack.cs

index 6dede959d31799233c2f89575ce2aa3adb24bb1e..5d0333311961ce716624fd938bfb3fa5178495e3 100644 (file)
@@ -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;