[FFmpeg-devel] [PATCH 1/1] avformat/http: handle SEEK_SET to filesize

vectronic hello.vectronic at gmail.com
Fri Apr 24 14:45:07 EEST 2020


> On 24 Apr 2020, at 12:09, vectronic <hello.vectronic at gmail.com> wrote:
> 
> 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.vectronic at 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)
> 

Apologies for confusion on this, I believe this issue has already been fixed this commit:

https://github.com/FFmpeg/FFmpeg/commit/69fcc093c1241b5ee7711c56c9cd558832a7e491 <https://github.com/FFmpeg/FFmpeg/commit/69fcc093c1241b5ee7711c56c9cd558832a7e491>

Therefore I believe the following has already been fixed and can be closed:

https://trac.ffmpeg.org/ticket/6885 <https://trac.ffmpeg.org/ticket/6885>



More information about the ffmpeg-devel mailing list