From 35f87dc6923d94c53a04169ccb97556601e9e20b Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 3 Jun 2014 15:57:47 +0200 Subject: audio/out/push: don't attempt to fill AO buffer when paused Doing so will implicitly resume playback. Broken in commit 5929dc45. --- audio/out/push.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'audio') diff --git a/audio/out/push.c b/audio/out/push.c index 4c789ef3a1..e98d3e6abb 100644 --- a/audio/out/push.c +++ b/audio/out/push.c @@ -283,7 +283,8 @@ static void *playthread(void *arg) struct ao_push_state *p = ao->api_priv; pthread_mutex_lock(&p->lock); while (!p->terminate) { - ao_play_data(ao); + if (!p->paused) + ao_play_data(ao); // Request new data from decoder if buffer goes below "full". // Allow a small margin of missing data for AOs that use timeouts. @@ -303,7 +304,7 @@ static void *playthread(void *arg) if (!p->need_wakeup) { MP_STATS(ao, "start audio wait"); - if (p->avoid_ao_wait) { + if (p->avoid_ao_wait || p->paused) { // Avoid busy waiting, because the audio API will still report // that it needs new data, even if we're not ready yet, or if // get_space() decides that the amount of audio buffered in the -- cgit v1.2.3