summaryrefslogtreecommitdiffstats
path: root/audio
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-04-04 14:47:42 +0200
committerwm4 <wm4@nowhere>2017-04-04 14:47:42 +0200
commitd018028fdb4710f18b7babf5f68ea0e89e0f7bd9 (patch)
tree1b5309b1345448833e058dfd6e7741a2e5575b19 /audio
parent6063cd569dafc1c6a0b4e9b0dfc6b9bf20461720 (diff)
downloadmpv-d018028fdb4710f18b7babf5f68ea0e89e0f7bd9.tar.bz2
mpv-d018028fdb4710f18b7babf5f68ea0e89e0f7bd9.tar.xz
af_lavfi: remove forced "format" filter
This was supposed to restrict output to formats supported by us. But we usually support all FFmpeg sample formats anyway (if not, it will error out gracefully, and we would add the missing format). Basically, it's just useless bloat.
Diffstat (limited to 'audio')
-rw-r--r--audio/filter/af_lavfi.c29
1 files changed, 2 insertions, 27 deletions
diff --git a/audio/filter/af_lavfi.c b/audio/filter/af_lavfi.c
index 55fb7cb0dc..6c371b7315 100644
--- a/audio/filter/af_lavfi.c
+++ b/audio/filter/af_lavfi.c
@@ -87,7 +87,7 @@ static bool recreate_graph(struct af_instance *af, struct mp_audio *config)
{
void *tmp = talloc_new(NULL);
struct priv *p = af->priv;
- AVFilterContext *in = NULL, *out = NULL, *f_format = NULL;
+ AVFilterContext *in = NULL, *out = NULL;
if (bstr0(p->cfg_graph).len == 0) {
MP_FATAL(af, "lavfi: no filter graph set\n");
@@ -109,24 +109,6 @@ static bool recreate_graph(struct af_instance *af, struct mp_audio *config)
if (!outputs || !inputs)
goto error;
- // Build list of acceptable output sample formats. libavfilter will insert
- // conversion filters if needed.
- static const enum AVSampleFormat sample_fmts[] = {
- AV_SAMPLE_FMT_U8, AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S32,
- AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_DBL,
- AV_SAMPLE_FMT_U8P, AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_S32P,
- AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_DBLP,
- AV_SAMPLE_FMT_NONE
- };
- char *fmtstr = talloc_strdup(tmp, "");
- for (int n = 0; sample_fmts[n] != AV_SAMPLE_FMT_NONE; n++) {
- const char *name = av_get_sample_fmt_name(sample_fmts[n]);
- if (name) {
- const char *s = fmtstr[0] ? "|" : "";
- fmtstr = talloc_asprintf_append_buffer(fmtstr, "%s%s", s, name);
- }
- }
-
char *src_args = talloc_asprintf(tmp,
"sample_rate=%d:sample_fmt=%s:time_base=%d/%d:"
"channel_layout=0x%"PRIx64, config->rate,
@@ -141,18 +123,11 @@ static bool recreate_graph(struct af_instance *af, struct mp_audio *config)
"out", NULL, NULL, graph) < 0)
goto error;
- if (avfilter_graph_create_filter(&f_format, avfilter_get_by_name("aformat"),
- "format", fmtstr, NULL, graph) < 0)
- goto error;
-
- if (avfilter_link(f_format, 0, out, 0) < 0)
- goto error;
-
outputs->name = av_strdup("in");
outputs->filter_ctx = in;
inputs->name = av_strdup("out");
- inputs->filter_ctx = f_format;
+ inputs->filter_ctx = out;
if (graph_parse(graph, p->cfg_graph, inputs, outputs, NULL) < 0)
goto error;