OSDN Git Service

asfdec: short-circuit seeking to the start of stream
authorAndrew Kelley <superjoe30@gmail.com>
Sun, 2 Feb 2014 23:05:58 +0000 (23:05 +0000)
committerJanne Grunau <janne-libav@jannau.net>
Wed, 12 Feb 2014 11:52:28 +0000 (12:52 +0100)
Bug-id: 43

Signed-off-by: Janne Grunau <janne-libav@jannau.net>
libavformat/asfdec.c

index e754cb2..8580ce0 100644 (file)
@@ -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);