summaryrefslogtreecommitdiff
path: root/libavformat/mov.c
diff options
context:
space:
mode:
authorBaptiste Coudurier <baptiste.coudurier@gmail.com>2006-03-24 16:52:56 +0000
committerBaptiste Coudurier <baptiste.coudurier@gmail.com>2006-03-24 16:52:56 +0000
commit99487f42b1ad20dd2638114433c3cb029048189d (patch)
treeefc8a1acc250faf89476d0f04d17fd031702d412 /libavformat/mov.c
parente1017f2b87cf501800867cbbb7e0be87c907b6f8 (diff)
fix demuxing of CDR-Dinner_LAN_800k.mp4
Originally committed as revision 5211 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/mov.c')
-rw-r--r--libavformat/mov.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 71bfbff865..3b34fd6490 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -946,12 +946,18 @@ static int mov_read_stsd(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom)
(format >> 0) & 0xff, (format >> 8) & 0xff, (format >> 16) & 0xff, (format >> 24) & 0xff,
st->codec->codec_type);
st->codec->codec_tag = format;
- /* codec_type is set earlier by read_hdlr */
- if(st->codec->codec_type==CODEC_TYPE_VIDEO) {
- /* for MPEG4: set codec type by looking for it */
+ id = codec_get_id(mov_audio_tags, format);
+ if (id > 0) {
+ st->codec->codec_type = CODEC_TYPE_AUDIO;
+ } else if (format != MKTAG('m', 'p', '4', 's')) { /* skip old asf mpeg4 tag */
id = codec_get_id(mov_video_tags, format);
- if(id <= 0)
+ if (id <= 0)
id = codec_get_id(codec_bmp_tags, format);
+ if (id > 0)
+ st->codec->codec_type = CODEC_TYPE_VIDEO;
+ }
+
+ if(st->codec->codec_type==CODEC_TYPE_VIDEO) {
st->codec->codec_id = id;
get_be16(pb); /* version */
get_be16(pb); /* revision level */
@@ -1058,7 +1064,7 @@ static int mov_read_stsd(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom)
} else if(st->codec->codec_type==CODEC_TYPE_AUDIO) {
uint16_t version = get_be16(pb);
- st->codec->codec_id = codec_get_id(mov_audio_tags, format);
+ st->codec->codec_id = id;
get_be16(pb); /* revision level */
get_be32(pb); /* vendor */