1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-22 06:42:03 +00:00
mpv/audio
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
..
decode options: remove deprecated --identify 2014-05-04 02:46:11 +02:00
filter af_lavcac3enc: detach on any passthrough format, not just ac3 2014-04-16 00:30:34 +02:00
out atomics: switch to C11 stdatomic.h 2014-05-21 02:21:18 +02:00
audio_buffer.c Split mpvcore/ into common/, misc/, bstr/ 2013-12-17 02:39:45 +01:00
audio_buffer.h
audio.c audio: preallocate audio buffers on resize 2014-04-18 16:19:46 +02:00
audio.h
chmap_sel.c chmap_sel: add channel replacement for sl/sr <-> sdl/sdr 2014-05-10 14:07:45 +02:00
chmap_sel.h
chmap.c options: fix off-by-1 error in option help output 2014-03-15 18:42:10 +01:00
chmap.h audio: add enum name for speaker id 2014-02-28 20:54:15 +01:00
fmt-conversion.c audio: fix format ID conversion 2013-12-23 21:24:41 +01:00
fmt-conversion.h
format.c Split mpvcore/ into common/, misc/, bstr/ 2013-12-17 02:39:45 +01:00
format.h audio: fix signedness of AF_FORMAT_S32P 2014-02-05 18:53:00 +01:00
mixer.c mixer: make code more readable 2014-05-11 16:41:19 +02:00
mixer.h command: use the step size for "add volume" commands 2014-02-27 01:07:46 +01:00