summaryrefslogtreecommitdiff
path: root/libavformat/utils.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-06-06 00:55:12 +0200
committerMichael Niedermayer <michaelni@gmx.at>2015-06-06 01:02:43 +0200
commit42c41e96ff6dc4fa24d98e1913aff925b8122776 (patch)
treeb4d6c3f650d337ba5631c520a8b09181ddfd3d5c /libavformat/utils.c
parent51080dfa0843c77002df9e5e4dbd20693f5dd813 (diff)
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.c2
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);