private void getTypes(out AudioEncoderType[] aCodec, out MuxableType[] audioTypes, out MuxableType[] subtitleTypes) { List <MuxableType> audioTypesList = new List <MuxableType>(); List <MuxableType> subTypesList = new List <MuxableType>(); List <AudioEncoderType> audioCodecList = new List <AudioEncoderType>(); int counter = 0; foreach (MuxStreamControl c in audioTracks) { if (minimizedMode && knownAudioTypes.Length > counter) { audioCodecList.Add(knownAudioTypes[counter]); } else if (c.Stream != null) { MuxableType audioType = VideoUtil.guessAudioMuxableType(c.Stream.path, true); if (audioType != null) { audioTypesList.Add(audioType); } } counter++; } foreach (MuxStreamControl c in subtitleTracks) { if (c.Stream == null) { continue; } SubtitleType subtitleType = VideoUtil.guessSubtitleType(c.Stream.path); if (subtitleType != null) { subTypesList.Add(new MuxableType(subtitleType, null)); } } audioTypes = audioTypesList.ToArray(); subtitleTypes = subTypesList.ToArray(); aCodec = audioCodecList.ToArray(); }
private void getTypes(out AudioEncoderType[] aCodec, out MuxableType[] audioTypes, out MuxableType[] subtitleTypes) { List <MuxableType> audioTypesList = new List <MuxableType>(); List <MuxableType> subTypesList = new List <MuxableType>(); List <AudioEncoderType> audioCodecList = new List <AudioEncoderType>(); int counter = 0; foreach (SubStream stream in audioStreams) { if (minimizedMode && knownAudioTypes.Length > counter) { audioCodecList.Add((AudioEncoderType)knownAudioTypes[counter].codec); } else { MuxableType audioType = VideoUtil.guessAudioMuxableType(stream.path, true); if (audioType != null) { audioTypesList.Add(audioType); } } counter++; } foreach (SubStream stream in subtitleStreams) { SubtitleType subtitleType = VideoUtil.guessSubtitleType(stream.path); if (subtitleType != null) { subTypesList.Add(new MuxableType(subtitleType, null)); } } audioTypes = audioTypesList.ToArray(); subtitleTypes = subTypesList.ToArray(); aCodec = audioCodecList.ToArray(); }