[FFmpeg-cvslog] asfdec: fix seeking with fragmented packets

Janne Grunau git at videolan.org
Wed Feb 12 17:02:42 CET 2014


ffmpeg | branch: master | Janne Grunau <janne-libav at jannau.net> | Tue Feb 11 13:01:38 2014 +0100| [f5d92d9cab07429b084c88262d9af1735ac8914a] | committer: Janne Grunau

asfdec: fix seeking with fragmented packets

After seeking fragments with an offset > 0 must be skipped to correctly
assemble packets.

Bug-Id: 43

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f5d92d9cab07429b084c88262d9af1735ac8914a
---

 libavformat/asfdec.c |   10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/libavformat/asfdec.c b/libavformat/asfdec.c
index 8580ce0..28a403a 100644
--- a/libavformat/asfdec.c
+++ b/libavformat/asfdec.c
@@ -1103,6 +1103,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;



More information about the ffmpeg-cvslog mailing list