From e2184fcbfb84029666d07fd49b4cab71b835e2e8 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 15 Apr 2014 22:38:16 +0200 Subject: 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. --- audio/out/internal.h | 1 + 1 file changed, 1 insertion(+) (limited to 'audio/out/internal.h') 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); -- cgit v1.2.3