diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-06-06 00:55:12 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-06-06 01:02:43 +0200 |
commit | 42c41e96ff6dc4fa24d98e1913aff925b8122776 (patch) | |
tree | b4d6c3f650d337ba5631c520a8b09181ddfd3d5c /libavformat/utils.c | |
parent | 51080dfa0843c77002df9e5e4dbd20693f5dd813 (diff) | |
download | ffmpeg-42c41e96ff6dc4fa24d98e1913aff925b8122776.tar.gz |
avformat/utils: Do not select audio streams with unknown sample rate in av_find_best_stream()
Together with the next commit this prevents non-PCM S302M from being selected unless either
it can be decoded or the user selects passthrough/copy
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r-- | libavformat/utils.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index c07bae210a..caa15abbae 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -3521,7 +3521,7 @@ int av_find_best_stream(AVFormatContext *ic, enum AVMediaType type, st->disposition & (AV_DISPOSITION_HEARING_IMPAIRED | AV_DISPOSITION_VISUAL_IMPAIRED)) continue; - if (type == AVMEDIA_TYPE_AUDIO && !avctx->channels) + if (type == AVMEDIA_TYPE_AUDIO && !(avctx->channels && avctx->sample_rate)) continue; if (decoder_ret) { decoder = find_decoder(ic, st, st->codec->codec_id); |