Mercurial > libavformat.hg
comparison wc3movie.c @ 4596:34aa256311f0 libavformat
use new metadata API in wc3 demuxer
author | aurel |
---|---|
date | Thu, 26 Feb 2009 22:35:26 +0000 |
parents | 49c1d3b27727 |
children | a9a2c60d0e84 |
comparison
equal
deleted
inserted
replaced
4595:af7b24671b7d | 4596:34aa256311f0 |
---|---|
130 ByteIOContext *pb = s->pb; | 130 ByteIOContext *pb = s->pb; |
131 unsigned int fourcc_tag; | 131 unsigned int fourcc_tag; |
132 unsigned int size; | 132 unsigned int size; |
133 AVStream *st; | 133 AVStream *st; |
134 unsigned char preamble[WC3_PREAMBLE_SIZE]; | 134 unsigned char preamble[WC3_PREAMBLE_SIZE]; |
135 char buffer[513]; | |
135 int ret = 0; | 136 int ret = 0; |
136 int current_palette = 0; | 137 int current_palette = 0; |
137 int bytes_to_read; | 138 int bytes_to_read; |
138 int i; | 139 int i; |
139 unsigned char rotate; | 140 unsigned char rotate; |
183 /* load up the name */ | 184 /* load up the name */ |
184 if ((unsigned)size < 512) | 185 if ((unsigned)size < 512) |
185 bytes_to_read = size; | 186 bytes_to_read = size; |
186 else | 187 else |
187 bytes_to_read = 512; | 188 bytes_to_read = 512; |
188 if ((ret = get_buffer(pb, s->title, bytes_to_read)) != bytes_to_read) | 189 if ((ret = get_buffer(pb, buffer, bytes_to_read)) != bytes_to_read) |
189 return AVERROR(EIO); | 190 return AVERROR(EIO); |
191 buffer[bytes_to_read] = 0; | |
192 av_metadata_set(&s->metadata, "title", buffer); | |
190 break; | 193 break; |
191 | 194 |
192 case SIZE_TAG: | 195 case SIZE_TAG: |
193 /* video resolution override */ | 196 /* video resolution override */ |
194 if ((ret = get_buffer(pb, preamble, WC3_PREAMBLE_SIZE)) != | 197 if ((ret = get_buffer(pb, preamble, WC3_PREAMBLE_SIZE)) != |