[FFmpeg-cvslog] avformat/utils: Do not detect video codecs when audio is expected
Michael Niedermayer
git at videolan.org
Wed May 4 22:24:10 CEST 2016
ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Wed May 4 21:31:18 2016 +0200| [824906a5416baed3842cb19bc24f4cb672c96ca8] | committer: Michael Niedermayer
avformat/utils: Do not detect video codecs when audio is expected
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=824906a5416baed3842cb19bc24f4cb672c96ca8
---
libavformat/utils.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 72396af..52395d4 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -315,6 +315,9 @@ static int set_codec_from_probe_data(AVFormatContext *s, AVStream *st,
fmt->name, score);
for (i = 0; fmt_id_type[i].name; i++) {
if (!strcmp(fmt->name, fmt_id_type[i].name)) {
+ if (fmt_id_type[i].type != AVMEDIA_TYPE_AUDIO &&
+ st->codecpar->sample_rate)
+ continue;
st->codecpar->codec_id = fmt_id_type[i].id;
st->codecpar->codec_type = fmt_id_type[i].type;
st->internal->need_context_update = 1;
More information about the ffmpeg-cvslog
mailing list