summaryrefslogtreecommitdiffstats
path: root/audio/out
diff options
context:
space:
mode:
authorThomas Weißschuh <thomas@t-8ch.de>2022-11-26 05:20:58 +0100
committerPhilip Langdale <github.philipl@overt.org>2022-12-22 15:14:08 -0800
commit657fd2804c75fd4c838012ecbf5ce4536e4d487b (patch)
treeccf01621fb3a6d1028090fcb717f213529143fdb /audio/out
parent874e28f4a41a916bb567a882063dd2589e9234e1 (diff)
downloadmpv-657fd2804c75fd4c838012ecbf5ce4536e4d487b.tar.bz2
mpv-657fd2804c75fd4c838012ecbf5ce4536e4d487b.tar.xz
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
Diffstat (limited to 'audio/out')
-rw-r--r--audio/out/buffer.c2
1 files changed, 1 insertions, 1 deletions
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)