summaryrefslogtreecommitdiff
path: root/libavformat/asf.c
diff options
context:
space:
mode:
authorBjörn Axelsson <gecko@acc.umu.se>2007-12-17 09:28:46 +0000
committerBenoit Fouet <benoit.fouet@free.fr>2007-12-17 09:28:46 +0000
commitfa13095a5db7c1eb9b04e3adaf95423819fa62b0 (patch)
treecfedacbcfd24b553f4fba5df9883a3069790c963 /libavformat/asf.c
parent08c015c075e4318acca01130896120d2aed4cead (diff)
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 Originally committed as revision 11248 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/asf.c')
-rw-r--r--libavformat/asf.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/libavformat/asf.c b/libavformat/asf.c
index b2f54d9639..2316ed570f 100644
--- a/libavformat/asf.c
+++ b/libavformat/asf.c
@@ -1049,6 +1049,14 @@ static int asf_read_seek(AVFormatContext *s, int stream_index, int64_t pts, int
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);