diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-08-06 23:07:23 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-08-06 23:36:42 +0400 |
commit | a80ce390df38b30f70012c9ce059129516664805 (patch) | |
tree | 3ff73f94e0e8c4c9c314570a994eaea94bcc284f /libavformat/avidec.c | |
parent | 21eafa18e6e0768e806eb40cbeb1e80eecbc1257 (diff) |
avidec: parse INFO tags at the end
Fixes Ticket1123
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/avidec.c')
-rw-r--r-- | libavformat/avidec.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/libavformat/avidec.c b/libavformat/avidec.c index b62cccdf09..cc716a2520 100644 --- a/libavformat/avidec.c +++ b/libavformat/avidec.c @@ -1376,16 +1376,19 @@ static int avi_load_index(AVFormatContext *s) AVIOContext *pb = s->pb; uint32_t tag, size; int64_t pos= avio_tell(pb); + int64_t next; int ret = -1; if (avio_seek(pb, avi->movi_end, SEEK_SET) < 0) goto the_end; // maybe truncated file av_dlog(s, "movi_end=0x%"PRIx64"\n", avi->movi_end); for(;;) { - if (url_feof(pb)) - break; tag = avio_rl32(pb); size = avio_rl32(pb); + if (url_feof(pb)) + break; + next = avio_tell(pb) + size + (size & 1); + av_dlog(s, "tag=%c%c%c%c size=0x%x\n", tag & 0xff, (tag >> 8) & 0xff, @@ -1397,11 +1400,15 @@ static int avi_load_index(AVFormatContext *s) avi_read_idx1(s, size) >= 0) { avi->index_loaded=2; ret = 0; + }else if(tag == MKTAG('L', 'I', 'S', 'T')) { + uint32_t tag1 = avio_rl32(pb); + + if (tag1 == MKTAG('I', 'N', 'F', 'O')) + ff_read_riff_info(s, size - 4); + }else if(!ret) break; - } - size += (size & 1); - if (avio_skip(pb, size) < 0) + if (avio_seek(pb, next, SEEK_SET) < 0) break; // something is wrong here } the_end: |