ao_pulse, core: make pulse thread wake up core for more data
commita0de4bc5000823c058aab6b02a7fdfb48275cb32
authorUoti Urpala <uau@mplayer2.org>
Sun, 25 Mar 2012 19:58:48 +0000 (25 22:58 +0300)
committerUoti Urpala <uau@mplayer2.org>
Mon, 26 Mar 2012 00:55:31 +0000 (26 03:55 +0300)
tree799a49605b04f39e2bc79604f0d93727a43e167d
parent4fed8ad19771f6c3cfdd01414ba11456007fd9b8
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.
input/input.c
input/input.h
libao2/ao_pulse.c
libao2/audio_out.c
libao2/audio_out.h
mplayer.c