summaryrefslogtreecommitdiffstats
path: root/audio/out/push.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-07-13 20:06:33 +0200
committerwm4 <wm4@nowhere>2014-07-13 20:06:33 +0200
commitfb54a1436aced8462d63c1cdbb4972c05829e26f (patch)
tree686a62c43ea7833e286c1d6d4bf1630e018c897f /audio/out/push.c
parentb505cab59742dd47125153e63c690bf6ef591f61 (diff)
downloadmpv-fb54a1436aced8462d63c1cdbb4972c05829e26f.tar.bz2
mpv-fb54a1436aced8462d63c1cdbb4972c05829e26f.tar.xz
audio: don't wait for draining if paused
Logic for this was missing from pull.c. For push.c it was missing if the driver didn't support it. But even if the driver supported it (such as with ao_alsa), strange behavior was observed by users. See issue #933. Always check explicitly whether the AO is in paused mode, and if so, don't drain. Possibly fixes #933. CC: @mpv-player/stable
Diffstat (limited to 'audio/out/push.c')
-rw-r--r--audio/out/push.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/audio/out/push.c b/audio/out/push.c
index 6b04586b43..0ecba19da7 100644
--- a/audio/out/push.c
+++ b/audio/out/push.c
@@ -146,6 +146,10 @@ static void drain(struct ao *ao)
struct ao_push_state *p = ao->api_priv;
pthread_mutex_lock(&p->lock);
+ if (p->paused) {
+ pthread_mutex_unlock(&p->lock);
+ return;
+ }
p->final_chunk = true;
p->drain = true;
wakeup_playthread(ao);
@@ -154,7 +158,8 @@ static void drain(struct ao *ao)
pthread_mutex_unlock(&p->lock);
if (!ao->driver->drain)
- ao_wait_drain(ao);
+ mp_sleep_us(get_delay(ao) * 1000000);
+ reset(ao);
}
static int unlocked_get_space(struct ao *ao)