mirror of
https://github.com/mpv-player/mpv
synced 2025-02-19 22:36:55 +00:00
stream: don't print reconnection message if no stream support
This code does not know whether the stream supports reconnecting until
STREAM_CTRL_RECONNECT is called. So the message should be printed after
it. To avoid that reconnects that succeed on the first try go unnoticed,
print a warning on success.
(cherry picked from commit 38114b6a36
)
This commit is contained in:
parent
4a6fdb7361
commit
5f4e4ede89
@ -401,13 +401,15 @@ static bool stream_reconnect(stream_t *s)
|
||||
if (mp_cancel_wait(s->cancel, sleep_secs))
|
||||
break;
|
||||
|
||||
MP_WARN(s, "Connection lost! Attempting to reconnect (%d)...\n", retry + 1);
|
||||
|
||||
int r = stream_control(s, STREAM_CTRL_RECONNECT, NULL);
|
||||
if (r == STREAM_UNSUPPORTED)
|
||||
break;
|
||||
if (r == STREAM_OK && stream_seek_unbuffered(s, pos) && s->pos == pos)
|
||||
if (r == STREAM_OK && stream_seek_unbuffered(s, pos) && s->pos == pos) {
|
||||
MP_WARN(s, "Reconnected successfully.\n");
|
||||
return true;
|
||||
}
|
||||
|
||||
MP_WARN(s, "Connection lost! Attempting to reconnect (%d)...\n", retry + 1);
|
||||
|
||||
sleep_secs = MPMAX(sleep_secs, 0.1);
|
||||
sleep_secs = MPMIN(sleep_secs * 4, 10.0);
|
||||
|
Loading…
Reference in New Issue
Block a user