From 972ea9ca5913a175e50eb36944ca0aa7224d9361 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 12 Jun 2016 20:59:11 +0200 Subject: audio: do not wake up core during EOF When we're draining, don't wakeup the core on every buffer fill, since unlike during normal playback, we won't actually get more data. The wakeup here conceptually works like wakeups with condition variables, so redundant wakeups do not hurt, so this is just a minor change and nothing of consequence. (Final EOF also requires waking up the core, but there is separate code to send this notification.) Also dump the p->still_playing field in trace logging. --- audio/out/push.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'audio') diff --git a/audio/out/push.c b/audio/out/push.c index 6884702108..8071ad0f8d 100644 --- a/audio/out/push.c +++ b/audio/out/push.c @@ -292,11 +292,12 @@ static void ao_play_data(struct ao *ao) // If we just filled the AO completely (r == space), don't refill for a // while. Prevents wakeup feedback with byte-granular AOs. int needed = unlocked_get_space(ao); - bool more = needed >= (r == space ? ao->device_buffer / 4 : 1) && !stuck; + bool more = needed >= (r == space ? ao->device_buffer / 4 : 1) && !stuck && + !(flags & AOPLAY_FINAL_CHUNK); if (more) mp_input_wakeup(ao->input_ctx); // request more data - MP_TRACE(ao, "in=%d flags=%d space=%d r=%d wa=%d needed=%d more=%d\n", - max, flags, space, r, p->wait_on_ao, needed, more); + MP_TRACE(ao, "in=%d flags=%d space=%d r=%d wa/pl=%d/%d needed=%d more=%d\n", + max, flags, space, r, p->wait_on_ao, p->still_playing, needed, more); } static void *playthread(void *arg) -- cgit v1.2.3