summaryrefslogtreecommitdiffstats
path: root/win/CS
diff options
context:
space:
mode:
authorsr55 <[email protected]>2012-01-07 19:15:22 +0000
committersr55 <[email protected]>2012-01-07 19:15:22 +0000
commit650a8ae79d83ee1cf9233cbd5ba01a7b242219a1 (patch)
treeed37a9a138364eeaf232e9daa9433800a9b7ec8c /win/CS
parent2fcd31e9ef0795d6d3a0c0201ba2e7650d0c4909 (diff)
WinGui: Couple of bug fixes to the Auto-Passthru feature.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4402 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS')
-rw-r--r--win/CS/Controls/AudioPanel.cs31
-rw-r--r--win/CS/HandBrake.ApplicationServices/Model/Encoding/AllowedPassthru.cs16
2 files changed, 40 insertions, 7 deletions
diff --git a/win/CS/Controls/AudioPanel.cs b/win/CS/Controls/AudioPanel.cs
index 69d4fb065..c7a055c9f 100644
--- a/win/CS/Controls/AudioPanel.cs
+++ b/win/CS/Controls/AudioPanel.cs
@@ -186,8 +186,8 @@ namespace Handbrake.Controls
{
ClearAudioList();
- ObservableCollection<AudioTrack> tracks = preset.Task.AudioTracks;
- this.PassthruSettings = preset.AudioPassthruSettings ?? new AllowedPassthru(false);
+ ObservableCollection<AudioTrack> tracks = new ObservableCollection<AudioTrack>(preset.Task.AudioTracks);
+ this.PassthruSettings = preset.AudioPassthruSettings != null ? new AllowedPassthru(preset.AudioPassthruSettings) : new AllowedPassthru(false);
this.SetPassthruSettings(this.PassthruSettings);
if (tracks == null || (drp_audioTrack.SelectedItem != null && drp_audioTrack.SelectedItem.ToString() == AudioHelper.NoneFound.Description))
@@ -209,7 +209,10 @@ namespace Handbrake.Controls
if (tracks.Count == 0 || tracks[0].ScannedTrack.TrackNumber == 0)
{
this.AutomaticTrackSelection();
- }
+ }
+
+ // Make sure correct audio encoder is still selected.
+ this.CheckAndFixPassthruCompatibility();
if (this.AudioListChanged != null)
this.AudioListChanged(this, new EventArgs());
@@ -226,10 +229,6 @@ namespace Handbrake.Controls
this.AudioTracks.Clear();
this.ScannedTracks.Clear();
- // Setup the passthru options
- this.PassthruSettings = preset.AudioPassthruSettings ?? new AllowedPassthru(false);
- this.SetPassthruSettings(this.PassthruSettings);
-
if (selectedTitle.AudioTracks.Count == 0)
{
this.ScannedTracks.Add(AudioHelper.NoneFound);
@@ -262,6 +261,9 @@ namespace Handbrake.Controls
{
this.AutomaticTrackSelection();
}
+
+ // Make sure correct audio encoder is still selected.
+ this.CheckAndFixPassthruCompatibility();
}
#endregion
@@ -1107,6 +1109,21 @@ namespace Handbrake.Controls
}
/// <summary>
+ /// Fix any invalid passthru problems.
+ /// </summary>
+ private void CheckAndFixPassthruCompatibility()
+ {
+ // Make sure correct audio encoder is still selected.
+ foreach (AudioTrack track in this.audioTracks)
+ {
+ if (this.IsIncompatiblePassthru(track))
+ {
+ track.Encoder = GetCompatiblePassthru(track);
+ }
+ }
+ }
+
+ /// <summary>
/// Setup the Passthru Settings Panel
/// </summary>
/// <param name="settings">
diff --git a/win/CS/HandBrake.ApplicationServices/Model/Encoding/AllowedPassthru.cs b/win/CS/HandBrake.ApplicationServices/Model/Encoding/AllowedPassthru.cs
index 748cfbdc4..a892eb119 100644
--- a/win/CS/HandBrake.ApplicationServices/Model/Encoding/AllowedPassthru.cs
+++ b/win/CS/HandBrake.ApplicationServices/Model/Encoding/AllowedPassthru.cs
@@ -42,6 +42,22 @@ namespace HandBrake.ApplicationServices.Model.Encoding
}
/// <summary>
+ /// Initializes a new instance of the <see cref="AllowedPassthru"/> class.
+ /// </summary>
+ /// <param name="initialValue">
+ /// The initial value.
+ /// </param>
+ public AllowedPassthru(AllowedPassthru initialValue)
+ {
+ this.AudioAllowAACPass = initialValue.AudioAllowAACPass;
+ this.AudioAllowAC3Pass = initialValue.AudioAllowAC3Pass;
+ this.AudioAllowDTSHDPass = initialValue.AudioAllowDTSHDPass;
+ this.AudioAllowDTSPass = initialValue.AudioAllowDTSPass;
+ this.AudioAllowMP3Pass = initialValue.AudioAllowMP3Pass;
+ this.AudioEncoderFallback = initialValue.AudioEncoderFallback;
+ }
+
+ /// <summary>
/// Gets or sets a value indicating whether AudioAllowAACPass.
/// </summary>
public bool AudioAllowAACPass { get; set; }