Merge remote-tracking branch 'qatar/master'
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 12 Feb 2014 15:36:04 +0000 (16:36 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 12 Feb 2014 15:36:15 +0000 (16:36 +0100)
* qatar/master:
  asfdec: fix seeking with fragmented packets

Merged-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/asfdec.c

index 4db908d3d9f59c6940d83ffff8f30f83977606ed..b5400b5f8785dbf775a00785bfd5e2ab3f67c3db 100644 (file)
@@ -1159,6 +1159,16 @@ static int asf_parse_packet(AVFormatContext *s, AVIOContext *pb, AVPacket *pkt)
         asf_st = asf->asf_st;
         av_assert0(asf_st);
 
+        if (!asf_st->frag_offset && asf->packet_frag_offset) {
+            av_dlog(s, "skipping asf data pkt with fragment offset for "
+                    "stream:%d, expected:%d but got %d from pkt)\n",
+                    asf->stream_index, asf_st->frag_offset,
+                    asf->packet_frag_offset);
+            avio_skip(pb, asf->packet_frag_size);
+            asf->packet_size_left -= asf->packet_frag_size;
+            continue;
+        }
+
         if (asf->packet_replic_size == 1) {
             // frag_offset is here used as the beginning timestamp
             asf->packet_frag_timestamp = asf->packet_time_start;