diff options
author | Victor Vasiliev <vasilvv@gmail.com> | 2011-11-25 00:02:43 +0400 |
---|---|---|
committer | Ronald S. Bultje <rsbultje@gmail.com> | 2011-11-26 17:14:13 -0800 |
commit | 12bc20502ad9124b4d922985b82edc45aa4064cb (patch) | |
tree | 15ced8ece39bde08672521de853c9e4137b34130 /libavformat/avidec.c | |
parent | 3f5aa7dfa64c8757e5eef7b1bf870ec754e40f96 (diff) | |
download | ffmpeg-12bc20502ad9124b4d922985b82edc45aa4064cb.tar.gz |
Generalize RIFF INFO tag support; support reading INFO tag in wav
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
Diffstat (limited to 'libavformat/avidec.c')
-rw-r--r-- | libavformat/avidec.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/libavformat/avidec.c b/libavformat/avidec.c index 0cd84c0d6b..ee4265538e 100644 --- a/libavformat/avidec.c +++ b/libavformat/avidec.c @@ -79,6 +79,11 @@ static const char avi_headers[][8] = { { 0 } }; +static const AVMetadataConv avi_metadata_conv[] = { + { "strn", "title" }, + { 0 }, +}; + static int avi_load_index(AVFormatContext *s); static int guess_ni_flag(AVFormatContext *s); @@ -261,15 +266,6 @@ static int avi_read_tag(AVFormatContext *s, AVStream *st, uint32_t tag, uint32_t AV_DICT_DONT_STRDUP_VAL); } -static void avi_read_info(AVFormatContext *s, uint64_t end) -{ - while (avio_tell(s->pb) < end) { - uint32_t tag = avio_rl32(s->pb); - uint32_t size = avio_rl32(s->pb); - avi_read_tag(s, NULL, tag, size); - } -} - static const char months[12][4] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; @@ -380,7 +376,7 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap) goto end_of_header; } else if (tag1 == MKTAG('I', 'N', 'F', 'O')) - avi_read_info(s, list_end); + ff_read_riff_info(s, size - 4); else if (tag1 == MKTAG('n', 'c', 'd', 't')) avi_read_nikon(s, list_end); @@ -745,7 +741,8 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap) clean_index(s); } - ff_metadata_conv_ctx(s, NULL, ff_avi_metadata_conv); + ff_metadata_conv_ctx(s, NULL, avi_metadata_conv); + ff_metadata_conv_ctx(s, NULL, ff_riff_info_conv); return 0; } |