summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-10-10 13:21:43 +0200
committerwm4 <wm4@nowhere>2014-10-10 13:21:43 +0200
commit7e4491a7a7e9ab41b38fd2ecb58f7b11731c9e05 (patch)
treecfb370b33ec7c5cf8ddf7f3b1a202c7b5272e10d
parentbd41fc7723a6e163de88c678826ff87779ee1af6 (diff)
downloadmpv-7e4491a7a7e9ab41b38fd2ecb58f7b11731c9e05.tar.bz2
mpv-7e4491a7a7e9ab41b38fd2ecb58f7b11731c9e05.tar.xz
audio/out/push: make draining slightly more robust
Don't wait after the audio thread has pushed the remaining audio to the AO. Avoids hard hangs if the heuristic fails completely (could still happen if get_delay returns absurd values). CC: @mpv-player/stable
-rw-r--r--audio/out/push.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/audio/out/push.c b/audio/out/push.c
index 27220e1d29..f94d445852 100644
--- a/audio/out/push.c
+++ b/audio/out/push.c
@@ -151,7 +151,7 @@ static void drain(struct ao *ao)
p->final_chunk = true;
wakeup_playthread(ao);
- while (p->still_playing)
+ while (p->still_playing && mp_audio_buffer_samples(p->buffer) > 0)
pthread_cond_wait(&p->wakeup, &p->lock);
if (ao->driver->drain) {