From 657fd2804c75fd4c838012ecbf5ce4536e4d487b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= Date: Sat, 26 Nov 2022 05:20:58 +0100 Subject: [PATCH] audio: reset pull AO at end of file When a pull AO reaches reaches EOF then ao_read_data() will set p->playing = false. Because the ao is marked as not playing ao_set_pause(true) will not reset the AO. This keeps the output stream unintentionally open. Fixes #9835 --- audio/out/buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/audio/out/buffer.c b/audio/out/buffer.c index 11bd14f733..bb681a9f1d 100644 --- a/audio/out/buffer.c +++ b/audio/out/buffer.c @@ -357,7 +357,7 @@ void ao_set_paused(struct ao *ao, bool paused) pthread_mutex_lock(&p->lock); - if (p->playing && !p->paused && paused) { + if ((p->playing || !ao->driver->write) && !p->paused && paused) { if (p->streaming && !ao->stream_silence) { if (ao->driver->write) { if (!p->recover_pause)