1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-22 06:42:03 +00:00
mpv/audio/out
wm4 8e7cf4bc99 atomics: switch to C11 stdatomic.h
In my opinion, we shouldn't use atomics at all, but ok.

This switches the mpv code to use C11 stdatomic.h, and for compilers
that don't support stdatomic.h yet, we emulate the subset used by mpv
using the builtins commonly provided by gcc and clang.

This supersedes an earlier similar attempt by Kovensky. That attempt
unfortunately relied on a big copypasted freebsd header (which also
depended on much more highly compiler-specific functionality, defined
reserved symbols, etc.), so it had to be NIH'ed.

Some issues:
- C11 says default initialization of atomics "produces a valid state",
  but it's not sure whether the stored value is really 0. But we rely on
  this.
- I'm pretty sure our use of the __atomic... builtins is/was incorrect.
  We don't use atomic load/store intrinsics, and access stuff directly.
- Our wrapper actually does stricter typechecking than the stdatomic.h
  implementation by gcc 4.9. We make the atomic types incompatible with
  normal types by wrapping them into structs. (The FreeBSD wrapper does
  the same.)
- I couldn't test on MinGW.
2014-05-21 02:21:18 +02:00
..
ao_alsa.c af_lavrresample: remove avresample_set_channel_mapping() fallbacks 2014-03-16 13:19:28 +01:00
ao_coreaudio_properties.c ao_coreaudio: move to new log API 2013-08-01 20:32:49 +02:00
ao_coreaudio_properties.h audio/out: make ao struct opaque 2014-03-09 00:19:31 +01:00
ao_coreaudio_utils.c ao_coreaudio: skip unknown channel labels 2014-05-10 14:07:45 +02:00
ao_coreaudio_utils.h ao_coreaudio: use description-based channel layouts 2014-05-10 14:07:45 +02:00
ao_coreaudio.c ao_coreaudio: remove useless code 2014-05-10 14:07:45 +02:00
ao_dsound.c ao_dsound: remove duplicated code 2014-03-16 13:19:28 +01:00
ao_jack.c audio/out: make draining a separate operation 2014-03-09 01:27:41 +01:00
ao_lavc.c encode: fix PTS unit mismatch 2014-05-10 10:44:16 +02:00
ao_null.c ao_null: fix unit mismatch with latency option 2014-05-04 16:57:32 +02:00
ao_openal.c audio/out: make draining a separate operation 2014-03-09 01:27:41 +01:00
ao_oss.c audio/out: make draining a separate operation 2014-03-09 01:27:41 +01:00
ao_pcm.c af_lavrresample: remove avresample_set_channel_mapping() fallbacks 2014-03-16 13:19:28 +01:00
ao_portaudio.c audio/out: make draining a separate operation 2014-03-09 01:27:41 +01:00
ao_pulse.c ao_pulse: use ao_need_data() 2014-04-15 22:42:15 +02:00
ao_rsound.c ao_rsound: pass correct data type to rsd_set_param() 2014-03-09 19:11:49 +01:00
ao_sdl.c ao_sdl: make sure our buffer is always larger than what SDL requests 2014-03-10 22:56:23 +01:00
ao_sndio.c audio/out: make draining a separate operation 2014-03-09 01:27:41 +01:00
ao_wasapi_utils.c atomics: switch to C11 stdatomic.h 2014-05-21 02:21:18 +02:00
ao_wasapi_utils.h ao_wasapi: Move non-critical code outside of the event thread 2014-03-11 16:37:02 -03:00
ao_wasapi.c atomics: switch to C11 stdatomic.h 2014-05-21 02:21:18 +02:00
ao_wasapi.h atomics: switch to C11 stdatomic.h 2014-05-21 02:21:18 +02:00
ao.c player: unrangle one aspect of audio EOF handling 2014-04-17 23:48:09 +02:00
ao.h player: unrangle one aspect of audio EOF handling 2014-04-17 23:48:09 +02:00
internal.h player: unrangle one aspect of audio EOF handling 2014-04-17 23:48:09 +02:00
pull.c atomics: switch to C11 stdatomic.h 2014-05-21 02:21:18 +02:00
push.c threads: use mpv time for mpthread_cond_timedwait wrapper 2014-05-18 19:20:32 +02:00