Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2015-09-06 20:05:52 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2015-09-06 21:43:38 +0300
commit7990beedee02b24850a20de651ecce5a96048ab9 (patch)
tree9be15d05d3f5abb43a7a0388ca0f9ec78dc3c62f /libavformat/http.c
parent1956cfbaedd364b30095e956fc881f7eaa1e21ff (diff)
avformat/http: require seekability only when seeking to position != 0
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/http.c')
-rw-r--r--libavformat/http.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavformat/http.c b/libavformat/http.c
index 20e942e147..476b53b3f6 100644
--- a/libavformat/http.c
+++ b/libavformat/http.c
@@ -1427,7 +1427,7 @@ static int64_t http_seek_internal(URLContext *h, int64_t off, int whence, int fo
((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)
+ else if ((s->filesize == -1 && whence == SEEK_END))
return AVERROR(ENOSYS);
if (whence == SEEK_CUR)
@@ -1440,6 +1440,9 @@ static int64_t http_seek_internal(URLContext *h, int64_t off, int whence, int fo
return AVERROR(EINVAL);
s->off = off;
+ if (s->off && h->is_streamed)
+ return AVERROR(ENOSYS);
+
/* we save the old context in case the seek fails */
old_buf_size = s->buf_end - s->buf_ptr;
memcpy(old_buf, s->buf_ptr, old_buf_size);