private void textBoxMediaFile_TextChanged(object sender, EventArgs e) { string filePattern = this.textBoxMediaFile.Text.Trim(); string[] files = UtilsCommon.getNonHiddenFiles(filePattern); this.comboBoxStreamAudioFromVideo.Enabled = true; this.labelAudioStream.Enabled = true; this.comboBoxStreamAudioFromVideo.Items.Clear(); if (files.Length != 0) { // Based on the first video file in the file pattern, get the list of available streams. string firstFile = files[0]; List <InfoStream> audioStreams = UtilsVideo.getAvailableAudioStreams(firstFile); if (audioStreams.Count > 0) { foreach (InfoStream stream in audioStreams) { this.comboBoxStreamAudioFromVideo.Items.Add(stream); } } else { // Show the default stream when the available streams cannot be detected this.comboBoxStreamAudioFromVideo.Items.Add(new InfoStream()); } this.comboBoxStreamAudioFromVideo.SelectedIndex = 0; } else { this.comboBoxStreamAudioFromVideo.Enabled = false; this.labelAudioStream.Enabled = false; } }