diff options
author | Thomas Weißschuh <thomas@t-8ch.de> | 2022-10-28 03:13:04 +0200 |
---|---|---|
committer | Philip Langdale <github.philipl@overt.org> | 2022-11-07 10:36:40 -0800 |
commit | 2e5d0d6e07b373445dfecc3bb59454d08d9439d5 (patch) | |
tree | 5f472e805218615e5901d8904141ac0db14b3e0e | |
parent | b7cf35c9a4d5068d3f14af30c38ab8496ad02a39 (diff) | |
download | mpv-2e5d0d6e07b373445dfecc3bb59454d08d9439d5.tar.bz2 mpv-2e5d0d6e07b373445dfecc3bb59454d08d9439d5.tar.xz |
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.
-rw-r--r-- | audio/out/ao_pipewire.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/audio/out/ao_pipewire.c b/audio/out/ao_pipewire.c index 0bb0bed937..8fe11f6b33 100644 --- a/audio/out/ao_pipewire.c +++ b/audio/out/ao_pipewire.c @@ -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) |