diff options
author | wm4 <wm4@nowhere> | 2016-06-12 20:59:11 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2016-06-12 20:59:11 +0200 |
commit | 972ea9ca5913a175e50eb36944ca0aa7224d9361 (patch) | |
tree | a26fcc8c7a89b5ca4557fee111d2c068b031c14a /audio | |
parent | 3d844cddf8179c0a6d1d65ed9c2b13b15f70180e (diff) | |
download | mpv-972ea9ca5913a175e50eb36944ca0aa7224d9361.tar.bz2 mpv-972ea9ca5913a175e50eb36944ca0aa7224d9361.tar.xz |
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.
Diffstat (limited to 'audio')
-rw-r--r-- | audio/out/push.c | 7 |
1 files changed, 4 insertions, 3 deletions
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) |