From 2da3cff1e8a5e1558d47a8493eaa9503b2d56b9e Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 4 Nov 2020 17:07:28 +0100 Subject: [PATCH] filter/LoadChain: use the AutoConvertFilter This adds support for input samples other than 16 bit to the FFmpeg filter plugin. --- NEWS | 1 + src/filter/LoadChain.cxx | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 46c7d8324..e0e7d2a83 100644 --- a/NEWS +++ b/NEWS @@ -4,6 +4,7 @@ ver 0.22.3 (not yet released) * filter - fix garbage after "Audio format not supported by filter" message - ffmpeg: support planar output + - ffmpeg: support sample formats other than 16 bit ver 0.22.2 (2020/10/28) * database diff --git a/src/filter/LoadChain.cxx b/src/filter/LoadChain.cxx index 01c886fce..cca351a72 100644 --- a/src/filter/LoadChain.cxx +++ b/src/filter/LoadChain.cxx @@ -20,6 +20,7 @@ #include "LoadChain.hxx" #include "Factory.hxx" #include "Prepared.hxx" +#include "plugins/AutoConvertFilterPlugin.hxx" #include "plugins/ChainFilterPlugin.hxx" #include "util/IterableSplitString.hxx" @@ -29,11 +30,14 @@ static void filter_chain_append_new(PreparedFilter &chain, FilterFactory &factory, std::string_view template_name) { + /* using the AutoConvert filter just in case the specified + filter plugin does not support the exact input format */ + filter_chain_append(chain, template_name, /* unfortunately, MakeFilter() wants a null-terminated string, so we need to copy it here */ - factory.MakeFilter(std::string(template_name).c_str())); + autoconvert_filter_new(factory.MakeFilter(std::string(template_name).c_str()))); } void