summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-10-10 13:21:43 +0200
committerAlessandro Ghedini <alessandro@ghedini.me>2014-10-11 14:03:13 +0200
commit1412b0171d3897409b2141be65eddf748d504f36 (patch)
tree453c110f1a5c0c2af497b834f1cfe764a3a3c21a
parent5c1c99b858a62dc306ba79bca8e616ca184db7f1 (diff)
downloadmpv-1412b0171d3897409b2141be65eddf748d504f36.tar.bz2
mpv-1412b0171d3897409b2141be65eddf748d504f36.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) {