summaryrefslogtreecommitdiff
path: root/libavformat/avidec.c
diff options
context:
space:
mode:
authorDavid Conrad <lessen42@gmail.com>2006-08-18 16:48:35 +0000
committerBenjamin Larsson <banan@ludd.ltu.se>2006-08-18 16:48:35 +0000
commit57060f8936e1d28ef328ed7a3999ec478bddc2a6 (patch)
tree775ebfec008d254382689c3a4322729a0c934f64 /libavformat/avidec.c
parentdb3924f1fd104caa669dabdb0869677349b80f99 (diff)
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.c24
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);