diff mbox series

[FFmpeg-devel,1/1] avformat hls restore options dict when retrying with a new connection

Message ID 20200430183503.83363-2-hello.vectronic@gmail.com
State New
Headers show
Series [FFmpeg-devel,1/1] avformat hls restore options dict when retrying with a new connection
Related show

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

vectronic April 30, 2020, 6:35 p.m. UTC
as per avio_open2 semantics after open_url_keepalive has failed, the options dictionary will have been modified and needs restoring before attempting a new connection

Signed-off-by: vectronic <hello.vectronic@gmail.com>
---
 libavformat/hls.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Steven Liu May 1, 2020, 12:43 a.m. UTC | #1
> 2020年5月1日 上午2:35,vectronic <hello.vectronic@gmail.com> 写道:
> 
> as per avio_open2 semantics after open_url_keepalive has failed, the options dictionary will have been modified and needs restoring before attempting a new connection
> 
> Signed-off-by: vectronic <hello.vectronic@gmail.com>
> ---
> libavformat/hls.c | 4 ++++
> 1 file changed, 4 insertions(+)
> 
> diff --git a/libavformat/hls.c b/libavformat/hls.c
> index fc45719d1c..9800c9bb8d 100644
> --- a/libavformat/hls.c
> +++ b/libavformat/hls.c
> @@ -679,6 +679,10 @@ static int open_url(AVFormatContext *s, AVIOContext **pb, const char *url,
>                 av_log(s, AV_LOG_WARNING,
>                     "keepalive request failed for '%s' with error: '%s' when opening url, retrying with new connection\n",
>                     url, av_err2str(ret));
> +
> +            av_dict_copy(&tmp, opts, 0);
> +            av_dict_copy(&tmp, opts2, 0);
> +
>             ret = s->io_open(s, pb, url, AVIO_FLAG_READ, &tmp);
>         }
>     } else {
> -- 
> 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-request@ffmpeg.org with subject "unsubscribe".

LGTM

Thanks

Steven Liu
diff mbox series

Patch

diff --git a/libavformat/hls.c b/libavformat/hls.c
index fc45719d1c..9800c9bb8d 100644
--- a/libavformat/hls.c
+++ b/libavformat/hls.c
@@ -679,6 +679,10 @@  static int open_url(AVFormatContext *s, AVIOContext **pb, const char *url,
                 av_log(s, AV_LOG_WARNING,
                     "keepalive request failed for '%s' with error: '%s' when opening url, retrying with new connection\n",
                     url, av_err2str(ret));
+
+            av_dict_copy(&tmp, opts, 0);
+            av_dict_copy(&tmp, opts2, 0);
+
             ret = s->io_open(s, pb, url, AVIO_FLAG_READ, &tmp);
         }
     } else {