summaryrefslogtreecommitdiffstats
path: root/audio/out/ao.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-07-13 20:06:33 +0200
committerAlessandro Ghedini <alessandro@ghedini.me>2014-07-14 13:48:31 +0200
commit78195cd74235dd53e527f075fe20cdcc94c202d4 (patch)
tree85a22e790dfab3913df775aa5121745f038acedb /audio/out/ao.c
parente7fc048eca2e3fcc1d799ad8f0f782d3ef7691e9 (diff)
downloadmpv-78195cd74235dd53e527f075fe20cdcc94c202d4.tar.bz2
mpv-78195cd74235dd53e527f075fe20cdcc94c202d4.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 378197bcb3..90c66b453b 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"
@@ -309,22 +308,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)