summaryrefslogtreecommitdiffstats
path: root/audio/out/ao.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/ao.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/ao.c')
-rw-r--r--audio/out/ao.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/audio/out/ao.c b/audio/out/ao.c
index 977b8eb69a..8e1ceb4bf1 100644
--- a/audio/out/ao.c
+++ b/audio/out/ao.c
@@ -31,7 +31,6 @@
#include "options/options.h"
#include "options/m_config.h"
-#include "osdep/timer.h"
#include "common/msg.h"
#include "common/common.h"
#include "common/global.h"
@@ -313,22 +312,11 @@ void ao_resume(struct ao *ao)
ao->api->resume(ao);
}
-// Be careful with locking
-void ao_wait_drain(struct ao *ao)
-{
- // This is probably not entirely accurate, but good enough.
- mp_sleep_us(ao_get_delay(ao) * 1000000);
- ao_reset(ao);
-}
-
// Block until the current audio buffer has played completely.
void ao_drain(struct ao *ao)
{
- if (ao->api->drain) {
+ if (ao->api->drain)
ao->api->drain(ao);
- } else {
- ao_wait_drain(ao);
- }
}
bool ao_eof_reached(struct ao *ao)