diff mbox

[FFmpeg-devel,v2] lavf/rtsp.c: Fix stimeout option not applied on http tunnel

Message ID 20190405185040.12501-1-junli1026@gmail.com
State Accepted
Commit 32148b5ac96b32a1086cf88db2cf18115fab314c
Headers show

Commit Message

Jun Li April 5, 2019, 6:50 p.m. UTC
stimeout option is already used in tcp transport, since
http is based on tcp, pass the option to http for tunneling
case.
---
 libavformat/rtsp.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

Comments

Jun Li April 5, 2019, 7 p.m. UTC | #1
On Fri, Apr 5, 2019 at 11:50 AM Jun Li <junli1026@gmail.com> wrote:

> stimeout option is already used in tcp transport, since
> http is based on tcp, pass the option to http for tunneling
> case.
> ---
>  libavformat/rtsp.c | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
> index 033095905d..8349840c96 100644
> --- a/libavformat/rtsp.c
> +++ b/libavformat/rtsp.c
> @@ -1744,6 +1744,9 @@ redirect:
>          char httpname[1024];
>          char sessioncookie[17];
>          char headers[1024];
> +        AVDictionary *options = NULL;
> +
> +        av_dict_set_int(&options, "timeout", rt->stimeout, 0);
>
>          ff_url_join(httpname, sizeof(httpname), https_tunnel ? "https" :
> "http", auth, host, port, "%s", path);
>          snprintf(sessioncookie, sizeof(sessioncookie), "%08x%08x",
> @@ -1774,7 +1777,8 @@ redirect:
>          }
>
>          /* complete the connection */
> -        if (ffurl_connect(rt->rtsp_hd, NULL)) {
> +        if (ffurl_connect(rt->rtsp_hd, &options)) {
> +            av_dict_free(&options);
>              err = AVERROR(EIO);
>              goto fail;
>          }
> @@ -1818,10 +1822,12 @@ redirect:
>          ff_http_init_auth_state(rt->rtsp_hd_out, rt->rtsp_hd);
>
>          /* complete the connection */
> -        if (ffurl_connect(rt->rtsp_hd_out, NULL)) {
> +        if (ffurl_connect(rt->rtsp_hd_out, &options)) {
> +            av_dict_free(&options);
>              err = AVERROR(EIO);
>              goto fail;
>          }
> +        av_dict_free(&options);
>      } else {
>          int ret;
>          /* open the tcp connection */
> --
> 2.17.1
>
>

Updated the version, free the memory in error path, patch is here:
https://patchwork.ffmpeg.org/patch/12620/
I initially planned to do that then I realized the error path will trigger
whole process to exit, which may be safe. But I agree with you, it is a
better practice to clean-up here.

Thanks for review, Michael.

Best Regards,
Jun
Jun Li April 9, 2019, 12:54 a.m. UTC | #2
Ping.

On Fri, Apr 5, 2019 at 12:00 PM Jun Li <junli1026@gmail.com> wrote:

>
>
> On Fri, Apr 5, 2019 at 11:50 AM Jun Li <junli1026@gmail.com> wrote:
>
>> stimeout option is already used in tcp transport, since
>> http is based on tcp, pass the option to http for tunneling
>> case.
>> ---
>>  libavformat/rtsp.c | 10 ++++++++--
>>  1 file changed, 8 insertions(+), 2 deletions(-)
>>
>> diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
>> index 033095905d..8349840c96 100644
>> --- a/libavformat/rtsp.c
>> +++ b/libavformat/rtsp.c
>> @@ -1744,6 +1744,9 @@ redirect:
>>          char httpname[1024];
>>          char sessioncookie[17];
>>          char headers[1024];
>> +        AVDictionary *options = NULL;
>> +
>> +        av_dict_set_int(&options, "timeout", rt->stimeout, 0);
>>
>>          ff_url_join(httpname, sizeof(httpname), https_tunnel ? "https" :
>> "http", auth, host, port, "%s", path);
>>          snprintf(sessioncookie, sizeof(sessioncookie), "%08x%08x",
>> @@ -1774,7 +1777,8 @@ redirect:
>>          }
>>
>>          /* complete the connection */
>> -        if (ffurl_connect(rt->rtsp_hd, NULL)) {
>> +        if (ffurl_connect(rt->rtsp_hd, &options)) {
>> +            av_dict_free(&options);
>>              err = AVERROR(EIO);
>>              goto fail;
>>          }
>> @@ -1818,10 +1822,12 @@ redirect:
>>          ff_http_init_auth_state(rt->rtsp_hd_out, rt->rtsp_hd);
>>
>>          /* complete the connection */
>> -        if (ffurl_connect(rt->rtsp_hd_out, NULL)) {
>> +        if (ffurl_connect(rt->rtsp_hd_out, &options)) {
>> +            av_dict_free(&options);
>>              err = AVERROR(EIO);
>>              goto fail;
>>          }
>> +        av_dict_free(&options);
>>      } else {
>>          int ret;
>>          /* open the tcp connection */
>> --
>> 2.17.1
>>
>>
>
> Updated the version, free the memory in error path, patch is here:
> https://patchwork.ffmpeg.org/patch/12620/
> I initially planned to do that then I realized the error path will trigger
> whole process to exit, which may be safe. But I agree with you, it is a
> better practice to clean-up here.
>
> Thanks for review, Michael.
>
> Best Regards,
> Jun
>
>
>
Liu Steven April 9, 2019, 1:23 a.m. UTC | #3
> 在 2019年4月9日,上午8:54,Jun Li <junli1026@gmail.com> 写道:
> 
> Ping.
> 
> On Fri, Apr 5, 2019 at 12:00 PM Jun Li <junli1026@gmail.com> wrote:
> 
>> 
>> 
>> On Fri, Apr 5, 2019 at 11:50 AM Jun Li <junli1026@gmail.com> wrote:
>> 
>>> stimeout option is already used in tcp transport, since
>>> http is based on tcp, pass the option to http for tunneling
>>> case.
>>> ---
>>> libavformat/rtsp.c | 10 ++++++++--
>>> 1 file changed, 8 insertions(+), 2 deletions(-)
>>> 
>>> diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
>>> index 033095905d..8349840c96 100644
>>> --- a/libavformat/rtsp.c
>>> +++ b/libavformat/rtsp.c
>>> @@ -1744,6 +1744,9 @@ redirect:
>>>         char httpname[1024];
>>>         char sessioncookie[17];
>>>         char headers[1024];
>>> +        AVDictionary *options = NULL;
>>> +
>>> +        av_dict_set_int(&options, "timeout", rt->stimeout, 0);
>>> 
>>>         ff_url_join(httpname, sizeof(httpname), https_tunnel ? "https" :
>>> "http", auth, host, port, "%s", path);
>>>         snprintf(sessioncookie, sizeof(sessioncookie), "%08x%08x",
>>> @@ -1774,7 +1777,8 @@ redirect:
>>>         }
>>> 
>>>         /* complete the connection */
>>> -        if (ffurl_connect(rt->rtsp_hd, NULL)) {
>>> +        if (ffurl_connect(rt->rtsp_hd, &options)) {
>>> +            av_dict_free(&options);
>>>             err = AVERROR(EIO);
>>>             goto fail;
>>>         }
>>> @@ -1818,10 +1822,12 @@ redirect:
>>>         ff_http_init_auth_state(rt->rtsp_hd_out, rt->rtsp_hd);
>>> 
>>>         /* complete the connection */
>>> -        if (ffurl_connect(rt->rtsp_hd_out, NULL)) {
>>> +        if (ffurl_connect(rt->rtsp_hd_out, &options)) {
>>> +            av_dict_free(&options);
>>>             err = AVERROR(EIO);
>>>             goto fail;
>>>         }
>>> +        av_dict_free(&options);
Why don’t move the av_dict_free(&options) to the fail?
>>>     } else {
>>>         int ret;
>>>         /* open the tcp connection */
>>> --
>>> 2.17.1
>>> 
>>> 
>> 
>> Updated the version, free the memory in error path, patch is here:
>> https://patchwork.ffmpeg.org/patch/12620/
>> I initially planned to do that then I realized the error path will trigger
>> whole process to exit, which may be safe. But I agree with you, it is a
>> better practice to clean-up here.
>> 
>> Thanks for review, Michael.
>> 
>> Best Regards,
>> Jun
>> 
>> 
>> 
> _______________________________________________
> 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”.




Thanks

Steven
Jun Li April 9, 2019, 3:19 a.m. UTC | #4
On Mon, Apr 8, 2019 at 6:23 PM Liu Steven <lq@chinaffmpeg.org> wrote:

>
>
> > 在 2019年4月9日,上午8:54,Jun Li <junli1026@gmail.com> 写道:
> >
> > Ping.
> >
> > On Fri, Apr 5, 2019 at 12:00 PM Jun Li <junli1026@gmail.com> wrote:
> >
> >>
> >>
> >> On Fri, Apr 5, 2019 at 11:50 AM Jun Li <junli1026@gmail.com> wrote:
> >>
> >>> stimeout option is already used in tcp transport, since
> >>> http is based on tcp, pass the option to http for tunneling
> >>> case.
> >>> ---
> >>> libavformat/rtsp.c | 10 ++++++++--
> >>> 1 file changed, 8 insertions(+), 2 deletions(-)
> >>>
> >>> diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
> >>> index 033095905d..8349840c96 100644
> >>> --- a/libavformat/rtsp.c
> >>> +++ b/libavformat/rtsp.c
> >>> @@ -1744,6 +1744,9 @@ redirect:
> >>>         char httpname[1024];
> >>>         char sessioncookie[17];
> >>>         char headers[1024];
> >>> +        AVDictionary *options = NULL;



>>> +
> >>> +        av_dict_set_int(&options, "timeout", rt->stimeout, 0);
> >>>
> >>>         ff_url_join(httpname, sizeof(httpname), https_tunnel ? "https"
> :
> >>> "http", auth, host, port, "%s", path);
> >>>         snprintf(sessioncookie, sizeof(sessioncookie), "%08x%08x",
> >>> @@ -1774,7 +1777,8 @@ redirect:
> >>>         }
> >>>
> >>>         /* complete the connection */
> >>> -        if (ffurl_connect(rt->rtsp_hd, NULL)) {
> >>> +        if (ffurl_connect(rt->rtsp_hd, &options)) {
> >>> +            av_dict_free(&options);
> >>>             err = AVERROR(EIO);
> >>>             goto fail;
> >>>         }
> >>> @@ -1818,10 +1822,12 @@ redirect:
> >>>         ff_http_init_auth_state(rt->rtsp_hd_out, rt->rtsp_hd);
> >>>
> >>>         /* complete the connection */
> >>> -        if (ffurl_connect(rt->rtsp_hd_out, NULL)) {
> >>> +        if (ffurl_connect(rt->rtsp_hd_out, &options)) {
> >>> +            av_dict_free(&options);
> >>>             err = AVERROR(EIO);
> >>>             goto fail;
> >>>         }
> >>> +        av_dict_free(&options);
> Why don’t move the av_dict_free(&options) to the fail?



Since the diff does not show the whole picture of the code, I simplify the
code as follows:

      if (is_tunnel) {
             AVDictionary *options = NULL;
             .....

             if (err) {
                   av_dict_free(&options);
                   goto fail;
             }
             av_dict_free(&options);
      } else {

      }

fail:
     // some clean-up code.


So if I put the "av_dict_free" in the fail, then I have to put the
"options" declaration outside of the if condition, to expand its scope so
that clean-up code can see/use.
Option 2 is to add a label tunnel_fail like this:

      if (is_tunnel) {
             AVDictionary *options = NULL;
             .....
             ......
             if (err) {
                   goto tunnel_fail;
             }

*tunnel_fail: *
             av_dict_free(&options);
             if (err) {
                  goto fai;
             }
      } else {

      }

fail:
     // some clean-up code.


The "tunnel_fail" label may be a little heavy if it is just for
"av_dict_free". But it still has its point.
And option 1 -- move the variable scope outside of the if condition is also
a little heavy.
What do you think ?



>>>     } else {
> >>>         int ret;
> >>>         /* open the tcp connection */
> >>> --
> >>> 2.17.1
> >>>
> >>>
> >>
> >> Updated the version, free the memory in error path, patch is here:
> >> https://patchwork.ffmpeg.org/patch/12620/
> >> I initially planned to do that then I realized the error path will
> trigger
> >> whole process to exit, which may be safe. But I agree with you, it is a
> >> better practice to clean-up here.
> >>
> >> Thanks for review, Michael.
> >>
> >> Best Regards,
> >> Jun
> >>
> >>
> >>
> > _______________________________________________
> > 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”.
>
>
>
>
> Thanks
>
> Steven
>
>
>
> _______________________________________________
> 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".


Thanks for review Steven !  I commented in-line.

Best Regards
-Jun
Jun Li April 11, 2019, 3:55 a.m. UTC | #5
On Mon, Apr 8, 2019 at 8:19 PM Jun Li <junli1026@gmail.com> wrote:

> On Mon, Apr 8, 2019 at 6:23 PM Liu Steven <lq@chinaffmpeg.org> wrote:
>
>>
>>
>> > 在 2019年4月9日,上午8:54,Jun Li <junli1026@gmail.com> 写道:
>> >
>> > Ping.
>> >
>> > On Fri, Apr 5, 2019 at 12:00 PM Jun Li <junli1026@gmail.com> wrote:
>> >
>> >>
>> >>
>> >> On Fri, Apr 5, 2019 at 11:50 AM Jun Li <junli1026@gmail.com> wrote:
>> >>
>> >>> stimeout option is already used in tcp transport, since
>> >>> http is based on tcp, pass the option to http for tunneling
>> >>> case.
>> >>> ---
>> >>> libavformat/rtsp.c | 10 ++++++++--
>> >>> 1 file changed, 8 insertions(+), 2 deletions(-)
>> >>>
>> >>> diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
>> >>> index 033095905d..8349840c96 100644
>> >>> --- a/libavformat/rtsp.c
>> >>> +++ b/libavformat/rtsp.c
>> >>> @@ -1744,6 +1744,9 @@ redirect:
>> >>>         char httpname[1024];
>> >>>         char sessioncookie[17];
>> >>>         char headers[1024];
>> >>> +        AVDictionary *options = NULL;
>
>
>
> >>> +
>> >>> +        av_dict_set_int(&options, "timeout", rt->stimeout, 0);
>> >>>
>> >>>         ff_url_join(httpname, sizeof(httpname), https_tunnel ?
>> "https" :
>> >>> "http", auth, host, port, "%s", path);
>> >>>         snprintf(sessioncookie, sizeof(sessioncookie), "%08x%08x",
>> >>> @@ -1774,7 +1777,8 @@ redirect:
>> >>>         }
>> >>>
>> >>>         /* complete the connection */
>> >>> -        if (ffurl_connect(rt->rtsp_hd, NULL)) {
>> >>> +        if (ffurl_connect(rt->rtsp_hd, &options)) {
>> >>> +            av_dict_free(&options);
>> >>>             err = AVERROR(EIO);
>> >>>             goto fail;
>> >>>         }
>> >>> @@ -1818,10 +1822,12 @@ redirect:
>> >>>         ff_http_init_auth_state(rt->rtsp_hd_out, rt->rtsp_hd);
>> >>>
>> >>>         /* complete the connection */
>> >>> -        if (ffurl_connect(rt->rtsp_hd_out, NULL)) {
>> >>> +        if (ffurl_connect(rt->rtsp_hd_out, &options)) {
>> >>> +            av_dict_free(&options);
>> >>>             err = AVERROR(EIO);
>> >>>             goto fail;
>> >>>         }
>> >>> +        av_dict_free(&options);
>> Why don’t move the av_dict_free(&options) to the fail?
>
>
>
> Since the diff does not show the whole picture of the code, I simplify the
> code as follows:
>
>       if (is_tunnel) {
>              AVDictionary *options = NULL;
>              .....
>
>              if (err) {
>                    av_dict_free(&options);
>                    goto fail;
>              }
>              av_dict_free(&options);
>       } else {
>
>       }
>
> fail:
>      // some clean-up code.
>
>
> So if I put the "av_dict_free" in the fail, then I have to put the
> "options" declaration outside of the if condition, to expand its scope so
> that clean-up code can see/use.
> Option 2 is to add a label tunnel_fail like this:
>
>       if (is_tunnel) {
>              AVDictionary *options = NULL;
>              .....
>              ......
>              if (err) {
>                    goto tunnel_fail;
>              }
>
> *tunnel_fail: *
>              av_dict_free(&options);
>              if (err) {
>                   goto fai;
>              }
>       } else {
>
>       }
>
> fail:
>      // some clean-up code.
>
>
> The "tunnel_fail" label may be a little heavy if it is just for
> "av_dict_free". But it still has its point.
> And option 1 -- move the variable scope outside of the if condition is
> also a little heavy.
> What do you think ?
>
>
>
> >>>     } else {
>> >>>         int ret;
>> >>>         /* open the tcp connection */
>> >>> --
>> >>> 2.17.1
>> >>>
>> >>>
>> >>
>> >> Updated the version, free the memory in error path, patch is here:
>> >> https://patchwork.ffmpeg.org/patch/12620/
>> >> I initially planned to do that then I realized the error path will
>> trigger
>> >> whole process to exit, which may be safe. But I agree with you, it is a
>> >> better practice to clean-up here.
>> >>
>> >> Thanks for review, Michael.
>> >>
>> >> Best Regards,
>> >> Jun
>> >>
>> >>
>> >>
>> > _______________________________________________
>> > 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”.
>>
>>
>>
>>
>> Thanks
>>
>> Steven
>>
>>
>>
>> _______________________________________________
>> 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".
>
>
> Thanks for review Steven !  I commented in-line.
>
> Best Regards
> -Jun
>

Ping.
Liu Steven April 11, 2019, 4:03 a.m. UTC | #6
> 在 2019年4月11日,上午11:55,Jun Li <junli1026@gmail.com> 写道:
> 
> On Mon, Apr 8, 2019 at 8:19 PM Jun Li <junli1026@gmail.com> wrote:
> 
>> On Mon, Apr 8, 2019 at 6:23 PM Liu Steven <lq@chinaffmpeg.org> wrote:
>> 
>>> 
>>> 
>>>> 在 2019年4月9日,上午8:54,Jun Li <junli1026@gmail.com> 写道:
>>>> 
>>>> Ping.
>>>> 
>>>> On Fri, Apr 5, 2019 at 12:00 PM Jun Li <junli1026@gmail.com> wrote:
>>>> 
>>>>> 
>>>>> 
>>>>> On Fri, Apr 5, 2019 at 11:50 AM Jun Li <junli1026@gmail.com> wrote:
>>>>> 
>>>>>> stimeout option is already used in tcp transport, since
>>>>>> http is based on tcp, pass the option to http for tunneling
>>>>>> case.
>>>>>> ---
>>>>>> libavformat/rtsp.c | 10 ++++++++--
>>>>>> 1 file changed, 8 insertions(+), 2 deletions(-)
>>>>>> 
>>>>>> diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
>>>>>> index 033095905d..8349840c96 100644
>>>>>> --- a/libavformat/rtsp.c
>>>>>> +++ b/libavformat/rtsp.c
>>>>>> @@ -1744,6 +1744,9 @@ redirect:
>>>>>>        char httpname[1024];
>>>>>>        char sessioncookie[17];
>>>>>>        char headers[1024];
>>>>>> +        AVDictionary *options = NULL;
>> 
>> 
>> 
>>>>> +
>>>>>> +        av_dict_set_int(&options, "timeout", rt->stimeout, 0);
>>>>>> 
>>>>>>        ff_url_join(httpname, sizeof(httpname), https_tunnel ?
>>> "https" :
>>>>>> "http", auth, host, port, "%s", path);
>>>>>>        snprintf(sessioncookie, sizeof(sessioncookie), "%08x%08x",
>>>>>> @@ -1774,7 +1777,8 @@ redirect:
>>>>>>        }
>>>>>> 
>>>>>>        /* complete the connection */
>>>>>> -        if (ffurl_connect(rt->rtsp_hd, NULL)) {
>>>>>> +        if (ffurl_connect(rt->rtsp_hd, &options)) {
>>>>>> +            av_dict_free(&options);
>>>>>>            err = AVERROR(EIO);
>>>>>>            goto fail;
>>>>>>        }
>>>>>> @@ -1818,10 +1822,12 @@ redirect:
>>>>>>        ff_http_init_auth_state(rt->rtsp_hd_out, rt->rtsp_hd);
>>>>>> 
>>>>>>        /* complete the connection */
>>>>>> -        if (ffurl_connect(rt->rtsp_hd_out, NULL)) {
>>>>>> +        if (ffurl_connect(rt->rtsp_hd_out, &options)) {
>>>>>> +            av_dict_free(&options);
>>>>>>            err = AVERROR(EIO);
>>>>>>            goto fail;
>>>>>>        }
>>>>>> +        av_dict_free(&options);
>>> Why don’t move the av_dict_free(&options) to the fail?
>> 
>> 
>> 
>> Since the diff does not show the whole picture of the code, I simplify the
>> code as follows:
>> 
>>      if (is_tunnel) {
>>             AVDictionary *options = NULL;
>>             .....
>> 
>>             if (err) {
>>                   av_dict_free(&options);
>>                   goto fail;
>>             }
>>             av_dict_free(&options);
>>      } else {
>> 
>>      }
>> 
>> fail:
>>     // some clean-up code.
>> 
>> 
>> So if I put the "av_dict_free" in the fail, then I have to put the
>> "options" declaration outside of the if condition, to expand its scope so
>> that clean-up code can see/use.
>> Option 2 is to add a label tunnel_fail like this:
>> 
>>      if (is_tunnel) {
>>             AVDictionary *options = NULL;
>>             .....
>>             ......
>>             if (err) {
>>                   goto tunnel_fail;
>>             }
>> 
>> *tunnel_fail: *
>>             av_dict_free(&options);
>>             if (err) {
>>                  goto fai;
>>             }
>>      } else {
>> 
>>      }
>> 
>> fail:
>>     // some clean-up code.
>> 
>> 
>> The "tunnel_fail" label may be a little heavy if it is just for
>> "av_dict_free". But it still has its point.
>> And option 1 -- move the variable scope outside of the if condition is
>> also a little heavy.
>> What do you think ?
>> 
>> 
>> 
>>>>>    } else {
>>>>>>        int ret;
>>>>>>        /* open the tcp connection */
>>>>>> --
>>>>>> 2.17.1
>>>>>> 
>>>>>> 
>>>>> 
>>>>> Updated the version, free the memory in error path, patch is here:
>>>>> https://patchwork.ffmpeg.org/patch/12620/
>>>>> I initially planned to do that then I realized the error path will
>>> trigger
>>>>> whole process to exit, which may be safe. But I agree with you, it is a
>>>>> better practice to clean-up here.
>>>>> 
>>>>> Thanks for review, Michael.
>>>>> 
>>>>> Best Regards,
>>>>> Jun
>>>>> 
>>>>> 
>>>>> 
>>>> _______________________________________________
>>>> 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”.
>>> 
>>> 
>>> 
>>> 
>>> Thanks
>>> 
>>> Steven
>>> 
>>> 
>>> 
>>> _______________________________________________
>>> 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".
>> 
>> 
>> Thanks for review Steven !  I commented in-line.
>> 
>> Best Regards
>> -Jun
>> 
> 
> Ping.
LGTM
> _______________________________________________
> 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".
Liu Steven April 15, 2019, 7:42 a.m. UTC | #7
> 在 2019年4月11日,下午12:03,Liu Steven <lq@chinaffmpeg.org> 写道:
> 
> 
> 
>> 在 2019年4月11日,上午11:55,Jun Li <junli1026@gmail.com> 写道:
>> ...
>> 
>> Ping.
> LGTM

Pushed


Thanks
Carl Eugen Hoyos April 15, 2019, 10:45 a.m. UTC | #8
2019-04-15 9:42 GMT+02:00, Liu Steven <lq@chinaffmpeg.org>:
>

>

>> 在 2019年4月11日,下午12:03,Liu Steven <lq@chinaffmpeg.org> 写道:

>>

>>

>>

>>> 在 2019年4月11日,上午11:55,Jun Li <junli1026@gmail.com> 写道:

>>> ...

>>>

>>> Ping.

>> LGTM

>

> Pushed


Who wrote the patch that you pushed?

Carl Eugen
Steven Liu April 15, 2019, 11:47 a.m. UTC | #9
Carl Eugen Hoyos <ceffmpeg@gmail.com> 于2019年4月15日周一 下午6:46写道:
>

> 2019-04-15 9:42 GMT+02:00, Liu Steven <lq@chinaffmpeg.org>:

> >

> >

> >> 在 2019年4月11日,下午12:03,Liu Steven <lq@chinaffmpeg.org> 写道:

> >>

> >>

> >>

> >>> 在 2019年4月11日,上午11:55,Jun Li <junli1026@gmail.com> 写道:

> >>> ...

> >>>

> >>> Ping.

> >> LGTM

> >

> > Pushed

>

> Who wrote the patch that you pushed?

>

Wow, thanks Carl, my mistake :(
Hendrik Leppkes April 15, 2019, 11:48 a.m. UTC | #10
On Mon, Apr 15, 2019 at 12:46 PM Carl Eugen Hoyos <ceffmpeg@gmail.com> wrote:
>
> 2019-04-15 9:42 GMT+02:00, Liu Steven <lq@chinaffmpeg.org>:
> >
> >
> >> 在 2019年4月11日,下午12:03,Liu Steven <lq@chinaffmpeg.org> 写道:
> >>
> >>
> >>
> >>> 在 2019年4月11日,上午11:55,Jun Li <junli1026@gmail.com> 写道:
> >>> ...
> >>>
> >>> Ping.
> >> LGTM
> >
> > Pushed
>
> Who wrote the patch that you pushed?
>

Also please carefully review anything you want to push. Needing 3
tries for one commit is just ridicoulous. Reverts still stay in the
history for ever.

- Hendrik
Steven Liu April 15, 2019, 11:51 a.m. UTC | #11
Hendrik Leppkes <h.leppkes@gmail.com> 于2019年4月15日周一 下午7:48写道:
>
> On Mon, Apr 15, 2019 at 12:46 PM Carl Eugen Hoyos <ceffmpeg@gmail.com> wrote:
> >
> > 2019-04-15 9:42 GMT+02:00, Liu Steven <lq@chinaffmpeg.org>:
> > >
> > >
> > >> 在 2019年4月11日,下午12:03,Liu Steven <lq@chinaffmpeg.org> 写道:
> > >>
> > >>
> > >>
> > >>> 在 2019年4月11日,上午11:55,Jun Li <junli1026@gmail.com> 写道:
> > >>> ...
> > >>>
> > >>> Ping.
> > >> LGTM
> > >
> > > Pushed
> >
Ok, i should review the Author of local commit message.
diff mbox

Patch

diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index 033095905d..8349840c96 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -1744,6 +1744,9 @@  redirect:
         char httpname[1024];
         char sessioncookie[17];
         char headers[1024];
+        AVDictionary *options = NULL;
+
+        av_dict_set_int(&options, "timeout", rt->stimeout, 0);
 
         ff_url_join(httpname, sizeof(httpname), https_tunnel ? "https" : "http", auth, host, port, "%s", path);
         snprintf(sessioncookie, sizeof(sessioncookie), "%08x%08x",
@@ -1774,7 +1777,8 @@  redirect:
         }
 
         /* complete the connection */
-        if (ffurl_connect(rt->rtsp_hd, NULL)) {
+        if (ffurl_connect(rt->rtsp_hd, &options)) {
+            av_dict_free(&options);
             err = AVERROR(EIO);
             goto fail;
         }
@@ -1818,10 +1822,12 @@  redirect:
         ff_http_init_auth_state(rt->rtsp_hd_out, rt->rtsp_hd);
 
         /* complete the connection */
-        if (ffurl_connect(rt->rtsp_hd_out, NULL)) {
+        if (ffurl_connect(rt->rtsp_hd_out, &options)) {
+            av_dict_free(&options);
             err = AVERROR(EIO);
             goto fail;
         }
+        av_dict_free(&options);
     } else {
         int ret;
         /* open the tcp connection */