summaryrefslogtreecommitdiffstats
path: root/input/input.h
diff options
context:
space:
mode:
authorUoti Urpala <uau@mplayer2.org>2012-03-25 22:58:48 +0300
committerUoti Urpala <uau@mplayer2.org>2012-03-26 03:55:31 +0300
commita0de4bc5000823c058aab6b02a7fdfb48275cb32 (patch)
tree799a49605b04f39e2bc79604f0d93727a43e167d /input/input.h
parent4fed8ad19771f6c3cfdd01414ba11456007fd9b8 (diff)
downloadmpv-a0de4bc5000823c058aab6b02a7fdfb48275cb32.tar.bz2
mpv-a0de4bc5000823c058aab6b02a7fdfb48275cb32.tar.xz
ao_pulse, core: make pulse thread wake up core for more data
For ao_pulse, the current latency is not a good indicator of how soon the AO requires new data to avoid underflow. Add an internal pipe that can be used to wake up the input loop from select(), and make the pulseaudio main loop (which runs in a separate thread) use this mechanism when pulse requests more data. The wakeup signal currently contains no information about the reason for the wakup, but audio buffers are always filled when the event loop wakes up. Also, request a latency of 1 second from the Pulseaudio server. The default is normally significantly higher. We don't need low latency, while higher latency helps prevent underflows reduces need for wakeups.
Diffstat (limited to 'input/input.h')
-rw-r--r--input/input.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/input/input.h b/input/input.h
index 4cd006fa9a..c5f6940990 100644
--- a/input/input.h
+++ b/input/input.h
@@ -272,6 +272,9 @@ void mp_input_uninit(struct input_ctx *ictx);
struct m_config;
void mp_input_register_options(struct m_config *cfg);
+// Wake up sleeping input loop from another thread.
+void mp_input_wakeup(struct input_ctx *ictx);
+
// Interruptible usleep: (used by libmpdemux)
int mp_input_check_interrupt(struct input_ctx *ictx, int time);