From 63a414c708ea2986386639124fdfa9cdbd58e520 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 30 Dec 2014 14:04:53 +0100 Subject: command: make empty vf-metadata not an error If a filter exists, but has no metadata, just return success. This allows the user to distinguish between no metadata available, and filter not inserted. See #1408. --- video/filter/vf.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'video/filter') diff --git a/video/filter/vf.c b/video/filter/vf.c index a424cc5856..8886c64ccb 100644 --- a/video/filter/vf.c +++ b/video/filter/vf.c @@ -170,10 +170,11 @@ int vf_control_by_label(struct vf_chain *c,int cmd, void *arg, bstr label) char *label_str = bstrdup0(NULL, label); struct vf_instance *cur = vf_find_by_label(c, label_str); talloc_free(label_str); - if (cur && cur->control) - return cur->control(cur, cmd, arg); - else + if (cur) { + return cur->control ? cur->control(cur, cmd, arg) : CONTROL_NA; + } else { return CONTROL_UNKNOWN; + } } static void vf_control_all(struct vf_chain *c, int cmd, void *arg) -- cgit v1.2.3