diff options
author | wm4 <wm4@nowhere> | 2014-04-15 22:38:16 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-04-15 22:38:16 +0200 |
commit | e2184fcbfb84029666d07fd49b4cab71b835e2e8 (patch) | |
tree | f304e9db9be6f2d2c3d7cf235901ba2bd2f5d4ca /audio/out/internal.h | |
parent | cad6425c466b29ede88d365eac465563b9c03570 (diff) | |
download | mpv-e2184fcbfb84029666d07fd49b4cab71b835e2e8.tar.bz2 mpv-e2184fcbfb84029666d07fd49b4cab71b835e2e8.tar.xz |
audio: wake up the core when audio buffer is running low
And also add a function ao_need_data(), which AO drivers can call if
their audio buffer runs low.
This change intends to make it easier for the playback thread: instead
of making the playback thread calculate a timeout at which the audio
buffer should be refilled, make the push.c audio thread wakeup the core
instead.
ao_need_data() is going to be used by ao_pulse, and we need to
workaround a stupid situation with pulseaudio causing a deadlock because
its callback still holds the internal pulseaudio lock.
For AOs that don't call ao_need_data(), the deadline is calculated by
the buffer fill status and latency, as before.
Diffstat (limited to 'audio/out/internal.h')
-rw-r--r-- | audio/out/internal.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/audio/out/internal.h b/audio/out/internal.h index ea655f65f2..4214c6c1d6 100644 --- a/audio/out/internal.h +++ b/audio/out/internal.h @@ -121,6 +121,7 @@ struct ao_driver { // These functions can be called by AOs. int ao_play_silence(struct ao *ao, int samples); +void ao_need_data(struct ao *ao); void ao_wait_drain(struct ao *ao); int ao_read_data(struct ao *ao, void **data, int samples, int64_t out_time_us); |