From 1412b0171d3897409b2141be65eddf748d504f36 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 10 Oct 2014 13:21:43 +0200 Subject: 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 --- audio/out/push.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) { -- cgit v1.2.3