http: Always allow no-op seek
authorAnssi Hannula <anssi.hannula@iki.fi>
Thu, 6 Mar 2014 17:40:01 +0000 (18:40 +0100)
committerLuca Barbato <lu_zero@gentoo.org>
Tue, 11 Mar 2014 21:08:57 +0000 (22:08 +0100)
This also allows checking stream position as per ffurl_seek() doxy.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
libavformat/http.c

index 2009621..cf4ccab 100644 (file)
@@ -901,6 +901,9 @@ 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 AVERROR(ENOSYS);