mpv/audio/filter
wm4 d725630b5f audio: add audio softvol processing to AO
This does what af_volume used to do. Since we couldn't relicense it,
just rewrite it. Since we don't have a new filter mechanism yet, and the
libavfilter is too inconvenient, do applying the volume gain in ao.c
directly. This is done before handling the audio data to the driver.

Since push.c runs a separate thread, and pull.c is called asynchronously
from the audio driver's thread, the volume value needs to be
synchronized. There's no existing central mutex, so do some shit with
atomics. Since there's no atomic_float type predefined (which is at
least needed when using the legacy wrapper), do some nonsense about
reinterpret casting the float value to an int for the purpose of atomic
access. Not sure if using memcpy() is undefined behavior, but for now I
don't care.

The advantage of not using a filter is lower complexity (no filter auto
insertion), and lower latency (gain processing is done after our
internal audio buffer of at least 200ms).

Disavdantages include inability to use native volume control _before_
other filters with custom filter chains, and the need to add new
processing for each new sample type.

Since this doesn't reuse any of the old GPL code, nor does indirectly
rely on it, volume and replaygain handling now works in LGPL mode.

How to process the gain is inspired by libavfilter's af_volume (LGPL).
In particular, we use exactly the same rounding, and we quantize
processing for integer sample types by 256 steps. Some of libavfilter's
copyright may or may not apply, but I think not, and it's the same
license anyway.
2017-11-29 21:30:51 +01:00
..
af.c audio: add audio softvol processing to AO 2017-11-29 21:30:51 +01:00
af.h audio: add audio softvol processing to AO 2017-11-29 21:30:51 +01:00
af_format.c af_format: change license to LGPL 2017-05-11 11:25:45 +02:00
af_lavcac3enc.c Replace remaining avcodec_close() calls 2017-07-16 12:51:48 +02:00
af_lavfi.c Get rid of deprecated AVFrame accessors 2017-10-30 13:36:44 +01:00
af_lavrresample.c audio: move libswresample wrapper out of audio filter code 2017-09-21 12:42:09 +02:00
af_rubberband.c af_rubberband: default to channels=together 2016-09-19 18:59:42 +02:00
af_scaletempo.c af_scaletempo: change license to LGPL 2017-05-09 12:53:37 +02:00
equalizer.h
tools.c af: move af_from_dB() function to af_volume.c 2015-06-23 15:11:23 +02:00