summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorStefano Pigozzi <stefano.pigozzi@gmail.com>2013-05-23 21:23:32 +0200
committerStefano Pigozzi <stefano.pigozzi@gmail.com>2013-06-16 18:20:39 +0200
commitbff03a181f8c4102a75144f818ea15ea53165170 (patch)
treee3c34701fdc88782cde8772baadcece5ad62b12a /Makefile
parentb537467fd33d55b743bbf8fcac562d3ade7cb7c3 (diff)
downloadmpv-bff03a181f8c4102a75144f818ea15ea53165170.tar.bz2
mpv-bff03a181f8c4102a75144f818ea15ea53165170.tar.xz
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.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile4
1 files changed, 2 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 670eb8de26..d39f37c971 100644
--- a/Makefile
+++ b/Makefile
@@ -84,8 +84,7 @@ SOURCES-$(ALSA) += audio/out/ao_alsa.c
SOURCES-$(CACA) += video/out/vo_caca.c
SOURCES-$(SDL) += audio/out/ao_sdl.c
SOURCES-$(SDL2) += video/out/vo_sdl.c
-SOURCES-$(COREAUDIO) += audio/out/ao_coreaudio.c \
- audio/out/ao_coreaudio/ca_ringbuffer.c
+SOURCES-$(COREAUDIO) += audio/out/ao_coreaudio.c
SOURCES-$(COREVIDEO) += video/out/vo_corevideo.m
SOURCES-$(DIRECT3D) += video/out/vo_direct3d.c \
video/out/w32_common.c
@@ -180,6 +179,7 @@ SOURCES = talloc.c \
core/mp_common.c \
core/mp_fifo.c \
core/mp_msg.c \
+ core/mp_ring.c \
core/mplayer.c \
core/options.c \
core/parser-cfg.c \