diff options
author | David Conrad <lessen42@gmail.com> | 2006-08-18 16:48:35 +0000 |
---|---|---|
committer | Benjamin Larsson <banan@ludd.ltu.se> | 2006-08-18 16:48:35 +0000 |
commit | 57060f8936e1d28ef328ed7a3999ec478bddc2a6 (patch) | |
tree | 775ebfec008d254382689c3a4322729a0c934f64 /libavformat/avidec.c | |
parent | db3924f1fd104caa669dabdb0869677349b80f99 (diff) | |
download | ffmpeg-57060f8936e1d28ef328ed7a3999ec478bddc2a6.tar.gz |
AVI tag reading and writing patch by David Conrad.
umovimus at gmail dot com
Originally committed as revision 6022 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/avidec.c')
-rw-r--r-- | libavformat/avidec.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/libavformat/avidec.c b/libavformat/avidec.c index 1c4ee6affe..fd50c86508 100644 --- a/libavformat/avidec.c +++ b/libavformat/avidec.c @@ -180,6 +180,15 @@ static void clean_index(AVFormatContext *s){ } } +static int avi_read_tag(ByteIOContext *pb, char *buf, int maxlen, unsigned int size) +{ + offset_t i = url_ftell(pb); + size += (size & 1); + get_strz(pb, buf, maxlen); + url_fseek(pb, i+size, SEEK_SET); + return 0; +} + static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap) { AVIContext *avi = s->priv_data; @@ -438,6 +447,21 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap) } url_fseek(pb, i+size, SEEK_SET); break; + case MKTAG('I', 'N', 'A', 'M'): + avi_read_tag(pb, s->title, sizeof(s->title), size); + break; + case MKTAG('I', 'A', 'R', 'T'): + avi_read_tag(pb, s->author, sizeof(s->author), size); + break; + case MKTAG('I', 'C', 'O', 'P'): + avi_read_tag(pb, s->copyright, sizeof(s->copyright), size); + break; + case MKTAG('I', 'C', 'M', 'T'): + avi_read_tag(pb, s->comment, sizeof(s->comment), size); + break; + case MKTAG('I', 'G', 'N', 'R'): + avi_read_tag(pb, s->genre, sizeof(s->genre), size); + break; default: /* skip tag */ size += (size & 1); |