changeset 3777:d4b086282604 libavformat

When setting codec_id during codec probe we must also set codec_type.
author andoma
date Mon, 25 Aug 2008 15:39:43 +0000
parents 8329c0373f69
children 85d3aca03313
files utils.c
diffstat 1 files changed, 9 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/utils.c	Mon Aug 25 06:20:00 2008 +0000
+++ b/utils.c	Mon Aug 25 15:39:43 2008 +0000
@@ -352,14 +352,19 @@
     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;
 }