[FFmpeg-cvslog] asfdec: short-circuit seeking to the start of stream

Andrew Kelley git at videolan.org
Wed Feb 12 16:36:34 CET 2014


ffmpeg | branch: master | Andrew Kelley <superjoe30 at gmail.com> | Sun Feb  2 23:05:58 2014 +0000| [0c082565965258dca143767cc6cb25e38b6e9ea3] | committer: Janne Grunau

asfdec: short-circuit seeking to the start of stream

Bug-id: 43

Signed-off-by: Janne Grunau <janne-libav at jannau.net>

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

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

diff --git a/libavformat/asfdec.c b/libavformat/asfdec.c
index e754cb2..8580ce0 100644
--- a/libavformat/asfdec.c
+++ b/libavformat/asfdec.c
@@ -1465,6 +1465,13 @@ static int asf_read_seek(AVFormatContext *s, int stream_index,
             return ret;
     }
 
+    /* explicitly handle the case of seeking to 0 */
+    if (!pts) {
+        asf_reset_header(s);
+        avio_seek(s->pb, s->data_offset, SEEK_SET);
+        return 0;
+    }
+
     if (!asf->index_read)
         ret = asf_build_simple_index(s, stream_index);
 



More information about the ffmpeg-cvslog mailing list