avidec: try to support oddly muxed MMES stream
authorMichael Niedermayer <michaelni@gmx.at>
Thu, 22 Nov 2012 22:08:01 +0000 (23:08 +0100)
committerCarl Eugen Hoyos <cehoyos@ag.or.at>
Mon, 10 Dec 2012 00:06:57 +0000 (01:06 +0100)
Fixes ticket1804

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit be89693ddc5a8cdeaf3edf48fb584d6adca54de0)

libavformat/avidec.c

index c4d41e5..1e71522 100644 (file)
@@ -1262,6 +1262,11 @@ static int avi_read_idx1(AVFormatContext *s, int size)
     avi->stream_index = -1;
     avio_seek(pb, idx1_pos, SEEK_SET);
 
+    if (s->nb_streams == 1 && s->streams[0]->codec->codec_tag == AV_RL32("MMES")){
+        first_packet_pos = 0;
+        data_offset = avi->movi_list;
+    }
+
     /* Read the entries and sort them in each stream component. */
     for(i = 0; i < nb_index_entries; i++) {
         if(url_feof(pb))