summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsr55 <[email protected]>2011-08-11 12:22:56 +0000
committersr55 <[email protected]>2011-08-11 12:22:56 +0000
commitdbc58639a0fa42cae9e884a50d6f8051516cfb6c (patch)
tree5a032fe42a672468ad3236c4226a39994c1d2488
parent8f930a4ecbf1bbb3f658fae5bdeb7c272ff4250e (diff)
WinGui: Fix a NullPointerException in the AudioPanel that was causing some funny behaviour when switching presets and scanning sources.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4165 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r--win/CS/Controls/AudioPanel.cs9
1 files changed, 7 insertions, 2 deletions
diff --git a/win/CS/Controls/AudioPanel.cs b/win/CS/Controls/AudioPanel.cs
index 19fe24787..0d7c1db77 100644
--- a/win/CS/Controls/AudioPanel.cs
+++ b/win/CS/Controls/AudioPanel.cs
@@ -192,8 +192,7 @@ namespace Handbrake.Controls
this.ScannedTracks.Clear();
if (selectedTitle.AudioTracks.Count == 0)
- {
-
+ {
this.ScannedTracks.Add(AudioHelper.NoneFound);
this.drp_audioTrack.Refresh();
drp_audioTrack.SelectedIndex = 0;
@@ -960,6 +959,12 @@ namespace Handbrake.Controls
/// </returns>
private bool IsIncompatiblePassthru(AudioTrack track)
{
+ if (track.ScannedTrack == null || string.IsNullOrEmpty(track.ScannedTrack.Format))
+ {
+ return false;
+ }
+
+
// If the track isn't AC3, and the encoder is, change it.
if (track.Encoder == AudioEncoder.Ac3Passthrough && !track.ScannedTrack.Format.Contains("AC3"))
{