diff options
author | wm4 <wm4@nowhere> | 2017-01-13 16:26:31 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2017-01-13 18:43:35 +0100 |
commit | e48f1f31cb8928b66834104bb492ade3eeafc701 (patch) | |
tree | 877794fbb32fa6434c7474a0e594006734f082f3 /video/filter | |
parent | 6c28824a926fdd8b420652f849194aad8aee6569 (diff) |
vf_lavfi: remove pixel format whitelist
Pointless now.
Diffstat (limited to 'video/filter')
-rw-r--r-- | video/filter/vf_lavfi.c | 24 |
1 files changed, 2 insertions, 22 deletions
diff --git a/video/filter/vf_lavfi.c b/video/filter/vf_lavfi.c index 6c18f829c4..aceaf50ecb 100644 --- a/video/filter/vf_lavfi.c +++ b/video/filter/vf_lavfi.c @@ -108,7 +108,7 @@ static bool recreate_graph(struct vf_instance *vf, struct mp_image_params *fmt) { void *tmp = talloc_new(NULL); struct vf_priv_s *p = vf->priv; - AVFilterContext *in = NULL, *out = NULL, *f_format = NULL; + AVFilterContext *in = NULL, *out = NULL; if (bstr0(p->cfg_graph).len == 0) { MP_FATAL(vf, "lavfi: no filter graph set\n"); @@ -130,19 +130,6 @@ static bool recreate_graph(struct vf_instance *vf, struct mp_image_params *fmt) if (!outputs || !inputs) goto error; - // Build list of acceptable output pixel formats. libavfilter will insert - // conversion filters if needed. - char *fmtstr = talloc_strdup(tmp, ""); - for (int n = IMGFMT_START; n < IMGFMT_END; n++) { - if (vf_next_query_format(vf, n)) { - const char *name = av_get_pix_fmt_name(imgfmt2pixfmt(n)); - if (name) { - const char *s = fmtstr[0] ? "|" : ""; - fmtstr = talloc_asprintf_append_buffer(fmtstr, "%s%s", s, name); - } - } - } - char *sws_flags = talloc_asprintf(tmp, "flags=%"PRId64, p->cfg_sws_flags); graph->scale_sws_opts = av_strdup(sws_flags); @@ -161,18 +148,11 @@ static bool recreate_graph(struct vf_instance *vf, struct mp_image_params *fmt) "out", NULL, NULL, graph) < 0) goto error; - if (avfilter_graph_create_filter(&f_format, avfilter_get_by_name("format"), - "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; |