aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnssi Hannula <anssi.hannula@iki.fi>2013-12-30 12:46:32 +0200
committerAnssi Hannula <anssi.hannula@iki.fi>2014-01-03 15:05:48 +0200
commit857841c1b63bf3ffacef03da2bd6275d55ead769 (patch)
tree2c1365157da82b865a75e57dd2e5d900d82a8768
parent0588acaffaf601bf47088bfa19bef49b173beb8c (diff)
downloadffmpeg-857841c1b63bf3ffacef03da2bd6275d55ead769.tar.gz
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@iki.fi>
-rw-r--r--libavformat/http.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/http.c b/libavformat/http.c
index fd29966e2a..3b655c6673 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;