0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 12:02:23 +02:00
mpv/audio
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
..
decode demux: get rid of demux_packet.new_segment field 2017-10-24 19:35:55 +02:00
filter audio: add audio softvol processing to AO 2017-11-29 21:30:51 +01:00
out audio: add audio softvol processing to AO 2017-11-29 21:30:51 +01:00
aconverter.c build: make it easier to force FFmpeg upstream 2017-11-01 16:50:18 +01:00
aconverter.h audio: move libswresample wrapper out of audio filter code 2017-09-21 12:42:09 +02:00
aframe.c aframe: fix logically dead code 2017-10-18 12:11:37 +02:00
aframe.h audio: move libswresample wrapper out of audio filter code 2017-09-21 12:42:09 +02:00
audio_buffer.c audio_buffer: remove dependency on mp_audio 2017-09-21 04:10:19 +02:00
audio_buffer.h audio_buffer: remove dependency on mp_audio 2017-09-21 04:10:19 +02:00
audio.c Get rid of deprecated AVFrame accessors 2017-10-30 13:36:44 +01:00
audio.h audio: make libaf derived code optional 2017-09-21 12:48:30 +02:00
chmap_sel.c audio: use --audio-channels=auto behavior, except on ALSA 2016-08-04 20:49:20 +02:00
chmap_sel.h audio: use --audio-channels=auto behavior, except on ALSA 2016-08-04 20:49:20 +02:00
chmap.c chmap: remove misleading "downmix" channel layout name 2017-06-24 11:36:10 +02:00
chmap.h player: remove special-case for DL/DR speakers 2016-08-04 19:14:35 +02:00
fmt-conversion.c audio/fmt-conversion: change license to LGPL 2017-05-05 07:25:55 +02:00
fmt-conversion.h audio/fmt-conversion: change license to LGPL 2017-05-05 07:25:55 +02:00
format.c audio: make libaf derived code optional 2017-09-21 12:48:30 +02:00
format.h audio: drop AF_FORMAT_S24 2017-07-07 17:56:22 +02:00