From fdb300b983744c522f335ccf64e9788b78f86701 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 21 Sep 2017 12:48:30 +0200 Subject: audio: make libaf derived code optional This code could not be relicensed. The intention was to write new filter code (which could handle both audio and video), but that's a bit of work. Write some code that can do audio conversion (resampling, downmixing, etc.) without the old audio filter chain code in order to speed up the LGPL relicensing. If you build with --disable-libaf, nothing in audio/filter/* is compiled in. It breaks a few features, such as --volume, --af, pitch correction on speed changes, replaygain. Most likely this adds some bugs, even if --disable-libaf is not used. (How the fuck does EOF notification work again anyway?) --- audio/audio.h | 2 ++ audio/decode/dec_audio.c | 3 +-- audio/filter/af.h | 5 +++++ audio/format.c | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) (limited to 'audio') diff --git a/audio/audio.h b/audio/audio.h index a4d9134a20..f370067b78 100644 --- a/audio/audio.h +++ b/audio/audio.h @@ -97,4 +97,6 @@ struct mp_audio *mp_audio_pool_new_copy(struct mp_audio_pool *pool, int mp_audio_pool_make_writeable(struct mp_audio_pool *pool, struct mp_audio *frame); +#include "filter/af.h" + #endif diff --git a/audio/decode/dec_audio.c b/audio/decode/dec_audio.c index 401e26fb7b..387a479a8c 100644 --- a/audio/decode/dec_audio.c +++ b/audio/decode/dec_audio.c @@ -29,6 +29,7 @@ #include "common/msg.h" #include "common/recorder.h" #include "misc/bstr.h" +#include "options/options.h" #include "stream/stream.h" #include "demux/demux.h" @@ -39,8 +40,6 @@ #include "ad.h" #include "audio/format.h" -#include "audio/filter/af.h" - extern const struct ad_functions ad_lavc; // Not a real codec - specially treated. diff --git a/audio/filter/af.h b/audio/filter/af.h index bbf7b53bad..4bd8f55b96 100644 --- a/audio/filter/af.h +++ b/audio/filter/af.h @@ -22,6 +22,11 @@ #include #include +#include "config.h" +#if !HAVE_LIBAF +#error "libaf disabled" +#endif + #include "options/options.h" #include "audio/format.h" #include "audio/chmap.h" diff --git a/audio/format.c b/audio/format.c index 9a0ebbee42..3df11ba301 100644 --- a/audio/format.c +++ b/audio/format.c @@ -20,7 +20,7 @@ #include #include "common/common.h" -#include "audio/filter/af.h" +#include "format.h" // number of bytes per sample, 0 if invalid/unknown int af_fmt_to_bytes(int format) -- cgit v1.2.3