summaryrefslogtreecommitdiffstats
path: root/win/CS/Controls
diff options
context:
space:
mode:
Diffstat (limited to 'win/CS/Controls')
-rw-r--r--win/CS/Controls/AudioPanel.cs31
1 files changed, 24 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">