diff options
author | wm4 <wm4@nowhere> | 2015-09-11 23:04:02 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-09-11 23:04:02 +0200 |
commit | 4e0e24c3c27362939d9f88d3e22267afef5f6d4f (patch) | |
tree | 5d8ad6f4a3ed84071b79e07df48e9bfc818db07f /audio/filter/af.c | |
parent | f095e86b61022613371334d80552b918946b9387 (diff) | |
download | mpv-4e0e24c3c27362939d9f88d3e22267afef5f6d4f.tar.bz2 mpv-4e0e24c3c27362939d9f88d3e22267afef5f6d4f.tar.xz |
af_lavfi: implement af-metadata property
Works like vf-metadata. Unfortunately requires some code duplication
(even though it's not much).
Fixes #2311.
Diffstat (limited to 'audio/filter/af.c')
-rw-r--r-- | audio/filter/af.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/audio/filter/af.c b/audio/filter/af.c index ba08c1ed9b..3f73ad9c58 100644 --- a/audio/filter/af.c +++ b/audio/filter/af.c @@ -695,6 +695,18 @@ void af_control_all(struct af_stream *s, int cmd, void *arg) af->control(af, cmd, arg); } +int af_control_by_label(struct af_stream *s, int cmd, void *arg, bstr label) +{ + char *label_str = bstrdup0(NULL, label); + struct af_instance *cur = af_find_by_label(s, label_str); + talloc_free(label_str); + if (cur) { + return cur->control ? cur->control(cur, cmd, arg) : CONTROL_NA; + } else { + return CONTROL_UNKNOWN; + } +} + // Used by filters to add a filtered frame to the output queue. // Ownership of frame is transferred from caller to the filter chain. void af_add_output_frame(struct af_instance *af, struct mp_audio *frame) |