diff mbox

[FFmpeg-devel] http: avoid logging reconnect warning if stream was aborted

Message ID 20180104160751.20071-1-nfxjfg@googlemail.com
State Accepted
Commit 2477bfe22121f04eff9e4ba2475f1f999c17ea36
Headers show

Commit Message

wm4 Jan. 4, 2018, 4:07 p.m. UTC
If the stream was aborted using the libavformat interrupt callback, we
don't want it to log the reconnect warning. (Exiting after logging this
warning worked well, so this is only for avoiding the ugly warning.)
---
I don't want to stick this as an additional condition into the 150
column while() condition, so it's a separate if.
---
 libavformat/http.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Ronald S. Bultje Jan. 4, 2018, 5:01 p.m. UTC | #1
Hi,

On Thu, Jan 4, 2018 at 11:07 AM, wm4 <nfxjfg@googlemail.com> wrote:

> If the stream was aborted using the libavformat interrupt callback, we
> don't want it to log the reconnect warning. (Exiting after logging this
> warning worked well, so this is only for avoiding the ugly warning.)
> ---
> I don't want to stick this as an additional condition into the 150
> column while() condition, so it's a separate if.
> ---
>  libavformat/http.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/libavformat/http.c b/libavformat/http.c
> index eb029e33a0..4806b1e59b 100644
> --- a/libavformat/http.c
> +++ b/libavformat/http.c
> @@ -1452,6 +1452,9 @@ static int http_read_stream(URLContext *h, uint8_t
> *buf, int size)
>          || (read_ret == AVERROR_EOF && s->reconnect_at_eof &&
> (!h->is_streamed || s->reconnect_streamed))) {
>          uint64_t target = h->is_streamed ? 0 : s->off;
>
> +        if (read_ret == AVERROR_EXIT)
> +            return read_ret;


Sure.

Ronald
wm4 Jan. 4, 2018, 5:11 p.m. UTC | #2
On Thu, 4 Jan 2018 12:01:02 -0500
"Ronald S. Bultje" <rsbultje@gmail.com> wrote:

> Hi,
> 
> On Thu, Jan 4, 2018 at 11:07 AM, wm4 <nfxjfg@googlemail.com> wrote:
> 
> > If the stream was aborted using the libavformat interrupt callback, we
> > don't want it to log the reconnect warning. (Exiting after logging this
> > warning worked well, so this is only for avoiding the ugly warning.)
> > ---
> > I don't want to stick this as an additional condition into the 150
> > column while() condition, so it's a separate if.
> > ---
> >  libavformat/http.c | 3 +++
> >  1 file changed, 3 insertions(+)
> >
> > diff --git a/libavformat/http.c b/libavformat/http.c
> > index eb029e33a0..4806b1e59b 100644
> > --- a/libavformat/http.c
> > +++ b/libavformat/http.c
> > @@ -1452,6 +1452,9 @@ static int http_read_stream(URLContext *h, uint8_t
> > *buf, int size)
> >          || (read_ret == AVERROR_EOF && s->reconnect_at_eof &&
> > (!h->is_streamed || s->reconnect_streamed))) {
> >          uint64_t target = h->is_streamed ? 0 : s->off;
> >
> > +        if (read_ret == AVERROR_EXIT)
> > +            return read_ret;  
> 
> 
> Sure.

Thanks, pushed.
diff mbox

Patch

diff --git a/libavformat/http.c b/libavformat/http.c
index eb029e33a0..4806b1e59b 100644
--- a/libavformat/http.c
+++ b/libavformat/http.c
@@ -1452,6 +1452,9 @@  static int http_read_stream(URLContext *h, uint8_t *buf, int size)
         || (read_ret == AVERROR_EOF && s->reconnect_at_eof && (!h->is_streamed || s->reconnect_streamed))) {
         uint64_t target = h->is_streamed ? 0 : s->off;
 
+        if (read_ret == AVERROR_EXIT)
+            return read_ret;
+
         if (reconnect_delay > s->reconnect_delay_max)
             return AVERROR(EIO);