summaryrefslogtreecommitdiffstats
path: root/video/filter/vf_lavfi.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-04-20 21:26:30 +0200
committerwm4 <wm4@nowhere>2014-04-21 02:56:48 +0200
commit44096073e96c623f3e3c80bed7ee13d58869cecd (patch)
tree256112c1fbcee67758998a23d3fd950b2c53219d /video/filter/vf_lavfi.c
parent0879db960dbbddf50a58ca8dac49e428658fc1c9 (diff)
downloadmpv-44096073e96c623f3e3c80bed7ee13d58869cecd.tar.bz2
mpv-44096073e96c623f3e3c80bed7ee13d58869cecd.tar.xz
vf_rotate: support all multiples of 90 degrees
This couldn't rotate by 180°. Add this, and also make the parameter in degrees, instead of magic numbers. For now, drop the flipping stuff. You can still flip with --vf=flip or --vf=mirror. Drop the landscape/portrait stuff - I think this is something almost nobody will use. If it turns out that we need some of these things, they can be readded later. Make it use libavfilter. Its vf_transpose implementation looks pretty simple, except that it uses slice threading and should be much faster.
Diffstat (limited to 'video/filter/vf_lavfi.c')
-rw-r--r--video/filter/vf_lavfi.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/video/filter/vf_lavfi.c b/video/filter/vf_lavfi.c
index abcaa79c2c..b100763e05 100644
--- a/video/filter/vf_lavfi.c
+++ b/video/filter/vf_lavfi.c
@@ -450,7 +450,7 @@ int vf_lw_set_graph(struct vf_instance *vf, struct vf_lw_opts *lavfi_opts,
{
if (!lavfi_opts)
lavfi_opts = (struct vf_lw_opts *)vf_lw_conf.defaults;
- if (!lavfi_opts->enable || !have_filter(filter))
+ if (!lavfi_opts->enable || (filter && !have_filter(filter)))
return -1;
MP_VERBOSE(vf, "Using libavfilter for '%s'\n", vf->info->name);
void *old_priv = vf->priv;
@@ -462,7 +462,8 @@ int vf_lw_set_graph(struct vf_instance *vf, struct vf_lw_opts *lavfi_opts,
va_list ap;
va_start(ap, opts);
char *s = talloc_vasprintf(vf, opts, ap);
- p->cfg_graph = talloc_asprintf(vf, "%s=%s", filter, s);
+ p->cfg_graph = filter ? talloc_asprintf(vf, "%s=%s", filter, s)
+ : talloc_strdup(vf, s);
talloc_free(s);
va_end(ap);
p->old_priv = old_priv;