From 24bad0ff777bb16926706c5b3712d622cc0ed81b Mon Sep 17 00:00:00 2001 From: sr55 Date: Wed, 18 Jan 2012 20:43:51 +0000 Subject: WinGui: Tweak the auto-correction of selected encoder feature on the audio panel so auto-passthru doesn't interfere with it. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4415 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- win/CS/Controls/AudioPanel.cs | 65 ++++++++++++++++++++++++++++++++----------- 1 file changed, 48 insertions(+), 17 deletions(-) diff --git a/win/CS/Controls/AudioPanel.cs b/win/CS/Controls/AudioPanel.cs index 8a976ab1a..fe7fab39f 100644 --- a/win/CS/Controls/AudioPanel.cs +++ b/win/CS/Controls/AudioPanel.cs @@ -1086,29 +1086,60 @@ namespace Handbrake.Controls /// private AudioEncoder GetCompatiblePassthru(AudioTrack track) { - if (track.ScannedTrack.Format.Contains("AC3") && this.check_ac3.Checked) + // + if (this.UserSettingService.GetUserSetting(UserSettingConstants.ShowAdvancedAudioPassthruOpts)) { - return AudioEncoder.Ac3Passthrough; - } + if (track.ScannedTrack.Format.Contains("AC3") && this.check_ac3.Checked) + { + return AudioEncoder.Ac3Passthrough; + } - if (track.ScannedTrack.Format.Contains("DTS") && this.check_dts.Checked) - { - return AudioEncoder.DtsPassthrough; - } + if (track.ScannedTrack.Format.Contains("DTS") && this.check_dts.Checked) + { + return AudioEncoder.DtsPassthrough; + } - if (track.ScannedTrack.Format.Contains("DTS-HD") && this.check_dtshd.Checked) - { - return AudioEncoder.DtsPassthrough; - } + if (track.ScannedTrack.Format.Contains("DTS-HD") && this.check_dtshd.Checked) + { + return AudioEncoder.DtsPassthrough; + } - if (track.ScannedTrack.Format.Contains("aac") && this.check_aac.Checked) - { - return AudioEncoder.AacPassthru; - } + if (track.ScannedTrack.Format.Contains("aac") && this.check_aac.Checked) + { + return AudioEncoder.AacPassthru; + } - if (track.ScannedTrack.Format.Contains("mp3") && this.check_mp3.Checked) + if (track.ScannedTrack.Format.Contains("mp3") && this.check_mp3.Checked) + { + return AudioEncoder.Mp3Passthru; + } + } + else { - return AudioEncoder.Mp3Passthru; + if (track.ScannedTrack.Format.Contains("AC3")) + { + return AudioEncoder.Ac3Passthrough; + } + + if (track.ScannedTrack.Format.Contains("DTS")) + { + return AudioEncoder.DtsPassthrough; + } + + if (track.ScannedTrack.Format.Contains("DTS-HD")) + { + return AudioEncoder.DtsPassthrough; + } + + if (track.ScannedTrack.Format.Contains("aac")) + { + return AudioEncoder.AacPassthru; + } + + if (track.ScannedTrack.Format.Contains("mp3")) + { + return AudioEncoder.Mp3Passthru; + } } return EnumHelper.GetValue(drp_passthruFallback.SelectedItem.ToString()); -- cgit v1.2.3