summaryrefslogtreecommitdiffstats
path: root/audio/filter/af.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-05-23 15:11:57 +0200
committerwm4 <wm4@nowhere>2013-05-23 17:44:06 +0200
commit60a7f3b8bc7caca5a60d763e5d57732c78e35a14 (patch)
treed9b580cde0217ae1d1039f72f7c532895c11123b /audio/filter/af.c
parent5bdf9d01cafd451fa971e94d5f2dab982338130a (diff)
downloadmpv-60a7f3b8bc7caca5a60d763e5d57732c78e35a14.tar.bz2
mpv-60a7f3b8bc7caca5a60d763e5d57732c78e35a14.tar.xz
af_lavfi: add libavfilter bridge
Mostly copied from vf_lavfi. The parts that could be shared are minor, because most code is about setting up audio and video, which are too different. This won't work with Libav. I used ffplay.c as guide, and noticed too late that their setup methods are incompatible with Libav's. Trying to make it work with both would be too much effort. The configure test for av_opt_set_int_list() should disable af_lavfi gracefully when compiling with Libav. Due to option parser chaos, you currently can't have a "," as part of the filter graph string - not even with quoting or escaping. This will probably be fixed later. The audio filter chain is not PTS aware. So we have to do some hacks to make up a fake PTS, and we have to map the output PTS back to the filter chain's method of tracking PTS changes and buffering, by adjusting af->delay.
Diffstat (limited to 'audio/filter/af.c')
-rw-r--r--audio/filter/af.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/audio/filter/af.c b/audio/filter/af.c
index 137e7cc407..f8d4336a52 100644
--- a/audio/filter/af.c
+++ b/audio/filter/af.c
@@ -48,6 +48,7 @@ extern struct af_info af_info_sinesuppress;
extern struct af_info af_info_karaoke;
extern struct af_info af_info_scaletempo;
extern struct af_info af_info_bs2b;
+extern struct af_info af_info_lavfi;
static struct af_info* filter_list[] = {
&af_info_dummy,
@@ -78,6 +79,9 @@ static struct af_info* filter_list[] = {
#ifdef CONFIG_LIBBS2B
&af_info_bs2b,
#endif
+#ifdef CONFIG_AF_LAVFI
+ &af_info_lavfi,
+#endif
// Must come last, because it's the fallback format conversion filter
&af_info_format,
NULL