1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-18 21:06:00 +00:00
mpv/audio/out
Stefano Pigozzi bff03a181f core: add a spsc ringbuffer implementation
Currently every single AO was implementing it's own ringbuffer, many times
with slightly different semantics. This is an attempt to fix the problem.

I stole some good ideas from ao_portaudio's ringbuffer and went from there.
The main difference is this one stores wpos and rpos which are absolute
positions in an "infinite" buffer. To find the actual position for writing /
reading just apply modulo size.

The producer only modifies wpos while the consumer only modifies rpos. This
makes it pretty easy to reason about and make the operations thread safe by
using barriers (thread safety is guaranteed only in the Single-Producer/Single-
Consumer case).

Also adapted ao_coreaudio to use this ringbuffer.
2013-06-16 18:20:39 +02:00
..
ao_alsa.c ao_alsa: always unset ALSA error handler, cleanup on init error 2013-05-26 16:44:18 +02:00
ao_coreaudio.c core: add a spsc ringbuffer implementation 2013-06-16 18:20:39 +02:00
ao_dsound.c ao_dsound: remove global variables 2013-06-04 01:22:50 +02:00
ao_jack.c ao_jack: remove global variables 2013-06-07 16:42:29 +02:00
ao_lavc.c encode_lavc strings: use new option syntax 2013-06-16 17:14:47 +02:00
ao_null.c Replace all calls to GetTimer()/GetTimerMS() 2013-05-26 16:44:20 +02:00
ao_openal.c ao_openal: switch to new AO API 2013-06-04 01:42:57 +02:00
ao_oss.c ao_oss: fix compilation on BSD 2013-06-11 12:24:11 +02:00
ao_pcm.c audio/out: channel map selection 2013-05-12 21:24:57 +02:00
ao_portaudio.c audio/out: channel map selection 2013-05-12 21:24:57 +02:00
ao_pulse.c audio/out: channel map selection 2013-05-12 21:24:57 +02:00
ao_rsound.c Replace calls to usec_sleep() 2013-05-26 16:44:20 +02:00
ao_sdl.c Replace all calls to GetTimer()/GetTimerMS() 2013-05-26 16:44:20 +02:00
ao.c audio: add channel map selection function 2013-05-12 21:24:57 +02:00
ao.h audio: add channel map selection function 2013-05-12 21:24:57 +02:00
audio_out_internal.h audio/out: switch to channel map 2013-05-12 21:24:54 +02:00