提交 42c41e96 编写于 作者: M Michael Niedermayer

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: NMichael Niedermayer <michaelni@gmx.at>
上级 51080dfa
...@@ -3521,7 +3521,7 @@ int av_find_best_stream(AVFormatContext *ic, enum AVMediaType type, ...@@ -3521,7 +3521,7 @@ int av_find_best_stream(AVFormatContext *ic, enum AVMediaType type,
st->disposition & (AV_DISPOSITION_HEARING_IMPAIRED | st->disposition & (AV_DISPOSITION_HEARING_IMPAIRED |
AV_DISPOSITION_VISUAL_IMPAIRED)) AV_DISPOSITION_VISUAL_IMPAIRED))
continue; continue;
if (type == AVMEDIA_TYPE_AUDIO && !avctx->channels) if (type == AVMEDIA_TYPE_AUDIO && !(avctx->channels && avctx->sample_rate))
continue; 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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册