Never favour an audio stream with 0 channels in av_find_best_stream().

Fixes ticket #3311.
This commit is contained in:
Carl Eugen Hoyos 2014-01-16 00:36:27 +01:00
parent 1132937077
commit cb36e441de

View File

@ -3263,6 +3263,8 @@ int av_find_best_stream(AVFormatContext *ic,
continue; continue;
if (st->disposition & (AV_DISPOSITION_HEARING_IMPAIRED|AV_DISPOSITION_VISUAL_IMPAIRED)) if (st->disposition & (AV_DISPOSITION_HEARING_IMPAIRED|AV_DISPOSITION_VISUAL_IMPAIRED))
continue; continue;
if (type == AVMEDIA_TYPE_AUDIO && !avctx->channels)
continue;
if (decoder_ret) { if (decoder_ret) {
decoder = find_decoder(ic, st, st->codec->codec_id); decoder = find_decoder(ic, st, st->codec->codec_id);
if (!decoder) { if (!decoder) {