[FFmpeg-cvslog] avformat/http: always allow no-op seek

Anssi Hannula git at videolan.org
Fri Jan 3 14:06:23 CET 2014


ffmpeg | branch: master | Anssi Hannula <anssi.hannula at iki.fi> | Mon Dec 30 12:46:32 2013 +0200| [857841c1b63bf3ffacef03da2bd6275d55ead769] | committer: Anssi Hannula

avformat/http: always allow no-op seek

This also allows checking stream position as per ffurl_seek() doxy.

Signed-off-by: Anssi Hannula <anssi.hannula at iki.fi>

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

 libavformat/http.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/http.c b/libavformat/http.c
index fd29966..3b655c6 100644
--- a/libavformat/http.c
+++ b/libavformat/http.c
@@ -947,6 +947,8 @@ static int64_t http_seek(URLContext *h, int64_t off, int whence)
 
     if (whence == AVSEEK_SIZE)
         return s->filesize;
+    else if ((whence == SEEK_CUR && off == 0) || (whence == SEEK_SET && off == s->off))
+        return s->off;
     else if ((s->filesize == -1 && whence == SEEK_END) || h->is_streamed)
         return -1;
 



More information about the ffmpeg-cvslog mailing list