1
0
mirror of https://github.com/mpv-player/mpv synced 2025-03-04 05:07:51 +00:00

ao_pipewire: reload ao on stream disconnect

This allows the core of mpv to know about issues in the AO.
Otherwise playback will just freeze as no more data callbacks are sent
by PipeWire.
Also it allows mpv to try to reconnect the AO or find another, working
AO.
This commit is contained in:
Thomas Weißschuh 2022-10-28 03:13:04 +02:00 committed by Philip Langdale
parent b7cf35c9a4
commit 2e5d0d6e07

View File

@ -223,6 +223,11 @@ static void on_state_changed(void *userdata, enum pw_stream_state old, enum pw_s
MP_WARN(ao, "Stream in error state, trying to reload...\n");
ao_request_reload(ao);
}
if (state == PW_STREAM_STATE_UNCONNECTED && old != PW_STREAM_STATE_UNCONNECTED) {
MP_WARN(ao, "Stream disconnected, trying to reload...\n");
ao_request_reload(ao);
}
}
static float spa_volume_to_mp_volume(float vol)