[FFmpeg-cvslog] avformat/http: require seekability only when seeking to position != 0

Michael Niedermayer git at videolan.org
Sun Sep 6 20:52:40 CEST 2015


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Sun Sep  6 19:05:52 2015 +0200| [7990beedee02b24850a20de651ecce5a96048ab9] | committer: Michael Niedermayer

avformat/http: require seekability only when seeking to position != 0

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 libavformat/http.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libavformat/http.c b/libavformat/http.c
index 20e942e..476b53b 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);



More information about the ffmpeg-cvslog mailing list