diff options
author | Kevin Mitchell <kevmitch@gmail.com> | 2014-04-13 07:00:11 -0700 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-04-13 18:03:01 +0200 |
commit | 7ae2eb8e2cbb041d22017632e95de6ac773db56a (patch) | |
tree | 3e283d18161fd472b8f1701d0f68acd08090d3e1 /video/filter/vf.c | |
parent | b11fdeab9ef94a4a0ce6a82877209662022067d9 (diff) | |
download | mpv-7ae2eb8e2cbb041d22017632e95de6ac773db56a.tar.bz2 mpv-7ae2eb8e2cbb041d22017632e95de6ac773db56a.tar.xz |
vf: add vf_control_by_label to send vfctrl to specific filter
Diffstat (limited to 'video/filter/vf.c')
-rw-r--r-- | video/filter/vf.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/video/filter/vf.c b/video/filter/vf.c index 118587766d..2e26ed0fbe 100644 --- a/video/filter/vf.c +++ b/video/filter/vf.c @@ -156,6 +156,17 @@ int vf_control_any(struct vf_chain *c, int cmd, void *arg) return CONTROL_UNKNOWN; } +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) + return cur->control(cur, cmd, arg); + else + return CONTROL_UNKNOWN; +} + static void vf_fix_img_params(struct mp_image *img, struct mp_image_params *p) { // Filters must absolutely set these correctly. |