diff asf.c @ 2827:f717dd23fc23 libavformat

Enable av_read_pause(), av_read_play() and the ASF demuxer's av_read_seek() to use the protocol-native functionality if available. Patch by Bj«Órn Axelsson: bjorn point axelsson at intinor dot se Original thread: [FFmpeg-devel] [PATCH][4/4] Enable use of the extended API Date: Thu Nov 22 16:01:06 CET 2007
author benoit
date Mon, 17 Dec 2007 09:28:46 +0000
parents d52c718e83f9
children bc317b8d7090
line wrap: on
line diff
--- a/asf.c	Sun Dec 16 18:51:00 2007 +0000
+++ b/asf.c	Mon Dec 17 09:28:46 2007 +0000
@@ -1049,6 +1049,14 @@
     if (asf->packet_size <= 0)
         return -1;
 
+    /* Try using the protocol's read_seek if available */
+    if(s->pb && s->pb->read_seek) {
+        int ret = av_url_read_fseek(s->pb, stream_index, pts, flags);
+        if(ret >= 0)
+            asf_reset_header(s);
+        return ret;
+    }
+
     if (!asf->index_read)
         asf_build_simple_index(s, stream_index);