diff options
author | Andreas Öman <andreas@lonelycoder.com> | 2008-08-25 15:39:43 +0000 |
---|---|---|
committer | Andreas Öman <andreas@lonelycoder.com> | 2008-08-25 15:39:43 +0000 |
commit | f1588ed525c76954e4a72ee2b2fb33d799fe17ed (patch) | |
tree | f225f793b73d91433997afb330b60dada6f0147c /libavformat | |
parent | 85803144636a177a94005c8cb2e6f574a2988a23 (diff) | |
download | ffmpeg-f1588ed525c76954e4a72ee2b2fb33d799fe17ed.tar.gz |
When setting codec_id during codec probe we must also set codec_type.
Originally committed as revision 14966 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/utils.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index 17e06d5108..1cc8bac23a 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -352,14 +352,19 @@ static int set_codec_from_probe_data(AVStream *st, AVProbeData *pd, int score) fmt = av_probe_input_format2(pd, 1, &score); if (fmt) { - if (!strcmp(fmt->name, "mp3")) + if (!strcmp(fmt->name, "mp3")) { st->codec->codec_id = CODEC_ID_MP3; - else if (!strcmp(fmt->name, "ac3")) + st->codec->codec_type = CODEC_TYPE_AUDIO; + } else if (!strcmp(fmt->name, "ac3")) { st->codec->codec_id = CODEC_ID_AC3; - else if (!strcmp(fmt->name, "mpegvideo")) + st->codec->codec_type = CODEC_TYPE_AUDIO; + } else if (!strcmp(fmt->name, "mpegvideo")) { st->codec->codec_id = CODEC_ID_MPEG2VIDEO; - else if (!strcmp(fmt->name, "h264")) + st->codec->codec_type = CODEC_TYPE_VIDEO; + } else if (!strcmp(fmt->name, "h264")) { st->codec->codec_id = CODEC_ID_H264; + st->codec->codec_type = CODEC_TYPE_VIDEO; + } } return !!fmt; } |