filter/ffmpeg: support double-precision samples

Insert an "aformat" filter which converts double-precision to
single-precision.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/1235
This commit is contained in:
Max Kellermann
2021-08-24 13:42:00 +02:00
parent b5b40d8235
commit 8439119e24
4 changed files with 26 additions and 1 deletions

View File

@@ -130,6 +130,14 @@ MakeAformat(AudioFormat &audio_format,
args, nullptr, graph_ctx);
}
AVFilterContext &
MakeAutoAformat(AVFilterGraph &graph_ctx)
{
return CreateFilter(RequireFilterByName("aformat"), "aformat",
"sample_fmts=flt|s32|s16",
nullptr, graph_ctx);
}
void
FilterGraph::ParseSingleInOut(const char *filters, AVFilterContext &in,
AVFilterContext &out)

View File

@@ -103,6 +103,13 @@ AVFilterContext &
MakeAformat(AudioFormat &audio_format,
AVFilterGraph &graph_ctx);
/**
* Create an "aformat" filter which automatically converts the output
* to a format supported by MPD.
*/
AVFilterContext &
MakeAutoAformat(AVFilterGraph &graph_ctx);
class FilterGraph {
AVFilterGraph *graph = nullptr;