diff options
author | Roine Gustafsson <roine@users.sourceforge.net> | 2005-01-26 09:31:49 +0000 |
---|---|---|
committer | François Revol <revol@free.fr> | 2005-01-26 09:31:49 +0000 |
commit | 53ffdd1434fbf0f5cc4d6c23d4907bd511863b15 (patch) | |
tree | e0865d56ec4076c4d5ddb6de8aefc8be661cb050 /libavformat/mov.c | |
parent | a64a006e95a674a6e257daa89b0eb2b74a26ec22 (diff) | |
download | ffmpeg-53ffdd1434fbf0f5cc4d6c23d4907bd511863b15.tar.gz |
mov header field and compressor name patch by Roine Gustafsson <roine AT users DOT sourceforge DOT net>
Originally committed as revision 3885 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/mov.c')
-rw-r--r-- | libavformat/mov.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c index e50f91f3f2..0d2ddce733 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -773,6 +773,7 @@ static int mov_read_stsd(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom) //MOVStreamContext *sc = (MOVStreamContext *)st->priv_data; int entries, frames_per_sample; uint32_t format; + uint8_t codec_name[32]; /* for palette traversal */ int color_depth; @@ -845,7 +846,11 @@ static int mov_read_stsd(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom) #ifdef DEBUG av_log(NULL, AV_LOG_DEBUG, "frames/samples = %d\n", frames_per_sample); #endif - get_buffer(pb, (uint8_t *)st->codec.codec_name, 32); /* codec name */ + get_buffer(pb, codec_name, 32); /* codec name, pascal string (FIXME: true for mp4?) */ + if (codec_name[0] <= 31) { + memcpy(st->codec.codec_name, &codec_name[1],codec_name[0]); + st->codec.codec_name[codec_name[0]] = 0; + } st->codec.bits_per_sample = get_be16(pb); /* depth */ st->codec.color_table_id = get_be16(pb); /* colortable id */ |