]> git.sesse.net Git - ffmpeg/commitdiff
avformat/hls: hide misleading warning when http reconnect is required
authorAman Gupta <aman@tmm1.net>
Sat, 23 Dec 2017 00:30:42 +0000 (16:30 -0800)
committerAman Gupta <aman@tmm1.net>
Sat, 23 Dec 2017 00:41:41 +0000 (16:41 -0800)
AVERROR_EOF is an internal error which means the http socket is no longer
valid for new requests. It informs the caller that a new connection must
be established, and as such does not need to be surfaced to the user as
a warning.

Signed-off-by: Aman Gupta <aman@tmm1.net>
libavformat/hls.c

index 26bf61c805273b9fa2b1db59d9f24528988e95f4..f718f2e6c1c616c2238ff1affab616192d682abd 100644 (file)
@@ -670,9 +670,10 @@ static int open_url(AVFormatContext *s, AVIOContext **pb, const char *url,
         if (ret == AVERROR_EXIT) {
             return ret;
         } else if (ret < 0) {
-            av_log(s, AV_LOG_WARNING,
-                "keepalive request failed for '%s', retrying with new connection: %s\n",
-                url, av_err2str(ret));
+            if (ret != AVERROR_EOF)
+                av_log(s, AV_LOG_WARNING,
+                    "keepalive request failed for '%s', retrying with new connection: %s\n",
+                    url, av_err2str(ret));
             ret = s->io_open(s, pb, url, AVIO_FLAG_READ, &tmp);
         }
     } else {
@@ -726,9 +727,10 @@ static int parse_playlist(HLSContext *c, const char *url,
         if (ret == AVERROR_EXIT) {
             return ret;
         } else if (ret < 0) {
-            av_log(c->ctx, AV_LOG_WARNING,
-                "keepalive request failed for '%s', retrying with new connection: %s\n",
-                url, av_err2str(ret));
+            if (ret != AVERROR_EOF)
+                av_log(c->ctx, AV_LOG_WARNING,
+                    "keepalive request failed for '%s', retrying with new connection: %s\n",
+                    url, av_err2str(ret));
             in = NULL;
         }
     }