]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/commitdiff
When setting codec_id during codec probe we must also set codec_type.
authorandoma <andoma@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Mon, 25 Aug 2008 15:39:43 +0000 (15:39 +0000)
committerandoma <andoma@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Mon, 25 Aug 2008 15:39:43 +0000 (15:39 +0000)
git-svn-id: file:///var/local/repositories/ffmpeg/trunk@14966 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b

libavformat/utils.c

index 17e06d5108fce20d529e444790473c18238ceb2b..1cc8bac23af90a5acb4a937d33365fd5e6b59367 100644 (file)
@@ -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;
 }