0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 12:02:23 +02:00
mpv/player
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
..
javascript js: add javascript scripting support using MuJS 2017-06-14 12:29:32 +02:00
lua osc: make cycling visibility an input.conf key binding 2017-11-03 14:41:18 +01:00
audio.c audio: add audio softvol processing to AO 2017-11-29 21:30:51 +01:00
client.c client API: change mpv_create() behavior, run init always on mpv thread 2017-06-30 13:14:39 +02:00
client.h client API: turn mpv_suspend() and mpv_resume() into stubs 2016-11-22 15:54:44 +01:00
command.c af: remove deprecated audio filters 2017-11-29 21:30:51 +01:00
command.h build: add preliminary LGPL mode 2017-09-21 13:56:27 +02:00
configfiles.c player: change default section when loading encoding-profiles.conf 2017-07-12 13:11:14 +02:00
core.h audio: make libaf derived code optional 2017-09-21 12:48:30 +02:00
external_files.c player: match subtitles with language tags with --sub-auto=exact 2017-11-27 19:45:13 +01:00
external_files.h external_files: change license to LGPL 2017-06-20 14:22:10 +02:00
javascript.c js: fix broken mp.set_property_number, mp.set_property_native 2017-09-23 14:41:17 +03:00
lavfi.c lavfi: fix warnings with newer libavfilter versions 2017-10-27 18:09:08 +02:00
lavfi.h audio: introduce a new type to hold audio frames 2017-08-16 21:10:54 +02:00
loadfile.c player: minor fix/simplification of OSD time/duration handling 2017-11-24 13:58:57 +01:00
lua.c lua: integrate stats.lua script 2017-10-09 20:47:33 +02:00
main.c player: log if NDEBUG is defined 2017-11-04 17:48:30 +01:00
misc.c player: make refresh seeks slightly more robust 2017-08-14 14:02:13 +02:00
osd.c player: change 3 remaining GPL-only code pieces to LGPL 2017-11-24 14:12:10 +01:00
playloop.c player: minor fix/simplification of OSD time/duration handling 2017-11-24 13:58:57 +01:00
screenshot.c screenshot: create directories from template 2017-11-02 17:07:35 +01:00
screenshot.h player: make screenshot commands honor the async flag 2017-04-01 20:47:23 +02:00
scripting.c lua: integrate stats.lua script 2017-10-09 20:47:33 +02:00
sub.c player: change license of most core files to LGPL 2017-06-23 16:55:02 +02:00
video.c video: remove automatic stereo3d filter insertion 2017-11-29 21:30:51 +01:00