From 7d10728aaadd171bc5e25545dae1c7dedd5145f7 Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 21 Mar 2018 14:48:01 +0100 Subject: demux, stream: ignore packets and errors on forced exit When this happens, network calls are forcibly aborted (more or less), but demuxers might keep going, as most of them do not check for forced exits properly. This can possibly lead to broken packets being added. Also do not attempt to read more packets in this situation. Also do not print a stream open failed message if opening was aborted anyway. --- stream/stream.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'stream') diff --git a/stream/stream.c b/stream/stream.c index 255e583de2..4f63236d6a 100644 --- a/stream/stream.c +++ b/stream/stream.c @@ -302,7 +302,8 @@ struct stream *stream_create(const char *url, int flags, continue; } if (r != STREAM_OK) { - mp_err(log, "Failed to open %s.\n", url); + if (!mp_cancel_test(c)) + mp_err(log, "Failed to open %s.\n", url); goto done; } } -- cgit v1.2.3