summaryrefslogtreecommitdiffstats
path: root/win/CS/Controls/AudioPanel.cs
diff options
context:
space:
mode:
Diffstat (limited to 'win/CS/Controls/AudioPanel.cs')
-rw-r--r--win/CS/Controls/AudioPanel.cs11
1 files changed, 7 insertions, 4 deletions
diff --git a/win/CS/Controls/AudioPanel.cs b/win/CS/Controls/AudioPanel.cs
index 8b385d992..66b25c5b0 100644
--- a/win/CS/Controls/AudioPanel.cs
+++ b/win/CS/Controls/AudioPanel.cs
@@ -190,7 +190,7 @@ namespace Handbrake.Controls
{
if (selectedTitle.AudioTracks.Count == 0)
{
- audioList.Rows.Clear();
+ this.AudioTracks.Clear();
this.ScannedTracks.Clear();
this.ScannedTracks.Add(AudioHelper.NoneFound);
this.drp_audioTrack.Refresh();
@@ -201,7 +201,7 @@ namespace Handbrake.Controls
// Setup the Audio track source dropdown with the new audio tracks.
this.ScannedTracks.Clear();
this.drp_audioTrack.SelectedItem = null;
- this.ScannedTracks = new BindingList<Audio>(selectedTitle.AudioTracks);
+ this.ScannedTracks = new BindingList<Audio>(selectedTitle.AudioTracks.ToList());
drp_audioTrack.DataSource = this.ScannedTracks;
drp_audioTrack.SelectedItem = this.ScannedTracks.FirstOrDefault();
@@ -218,7 +218,10 @@ namespace Handbrake.Controls
}
}
- this.AutomaticTrackSelection();
+ if (this.AudioTracks.Count > 0)
+ {
+ this.AutomaticTrackSelection();
+ }
}
#endregion
@@ -555,7 +558,7 @@ namespace Handbrake.Controls
/// </summary>
private void AutomaticTrackSelection()
{
- if (drp_audioTrack.SelectedItem.ToString() == AudioHelper.NoneFound.Description)
+ if (drp_audioTrack.SelectedItem != null && drp_audioTrack.SelectedItem.ToString() == AudioHelper.NoneFound.Description)
{
this.AudioTracks.Clear();
return;