mirror of
https://github.com/mpv-player/mpv
synced 2025-01-11 09:29:29 +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.
This commit is contained in:
parent
daf4334697
commit
38114b6a36
@ -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