if whence == SEEK_SET and offset is filesize and is_streamable is false
we can just return the filesize to prevent an HTTP 416 error

Signed-off-by: vectronic <hello.vectro...@gmail.com>
---
 libavformat/http.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/http.c b/libavformat/http.c
index c9415578aa..1adcc6eb67 100644
--- a/libavformat/http.c
+++ b/libavformat/http.c
@@ -1719,7 +1719,7 @@ static int64_t http_seek_internal(URLContext *h, int64_t 
off, int whence, int fo
     int old_buf_size, ret;
     AVDictionary *options = NULL;
 
-    if (whence == AVSEEK_SIZE)
+    if ((whence == AVSEEK_SIZE) || (whence == SEEK_SET && h->is_streamed == 0 
&& off == s->filesize))
         return s->filesize;
     else if (!force_reconnect &&
              ((whence == SEEK_CUR && off == 0) ||
-- 
2.24.2 (Apple Git-127)

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to