[FFmpeg-devel] [PATCH] avformat/http: Do not try to make a new request when seeking past the end of the file

Michael Niedermayer michaelni at gmx.at
Fri Feb 15 19:36:31 EET 2019


On Fri, Feb 15, 2019 at 11:34:43AM -0500, Vittorio Giovara wrote:
> From: Justin Ruggles <justin.ruggles at gmail.com>
> 
> This avoids making invalid HTTP Range requests for a byte range past the
> known end of the file during a seek. Those requests generally return a HTTP
> response of 416 Range Not Satisfiable, which causes an error response.
> 
> Reference: https://tools.ietf.org/html/rfc7233
> 
> Signed-off-by: Vittorio Giovara <vittorio.giovara at gmail.com>
> ---
>  libavformat/http.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/libavformat/http.c b/libavformat/http.c
> index a0a0636cf2..1e40268599 100644
> --- a/libavformat/http.c
> +++ b/libavformat/http.c
> @@ -1691,6 +1691,13 @@ static int64_t http_seek_internal(URLContext *h,
> int64_t off, int whence, int fo
>      if (s->off && h->is_streamed)
>          return AVERROR(ENOSYS);
> 
> +    /* do not try to make a new connection if seeking past the end of the
> file */

patch corrupted by newline


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Let us carefully observe those good qualities wherein our enemies excel us
and endeavor to excel them, by avoiding what is faulty, and imitating what
is excellent in them. -- Plutarch
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20190215/041e8acc/attachment.sig>


More information about the ffmpeg-devel mailing list