summaryrefslogtreecommitdiffstats
path: root/audio/filter/af.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-01-22 20:36:54 +0100
committerwm4 <wm4@nowhere>2016-01-22 20:36:54 +0100
commitf176104ed5c7be37f4f0756b7244cbb90c4fe1fe (patch)
treeae109c2306ced588fafc0d7ec3a913710bab2869 /audio/filter/af.c
parent4c25f49236fc0aef29ba14b2905ea02edab6ec07 (diff)
downloadmpv-f176104ed5c7be37f4f0756b7244cbb90c4fe1fe.tar.bz2
mpv-f176104ed5c7be37f4f0756b7244cbb90c4fe1fe.tar.xz
command: add af-command command
Similar to vf-command. Requested. Untested.
Diffstat (limited to 'audio/filter/af.c')
-rw-r--r--audio/filter/af.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/audio/filter/af.c b/audio/filter/af.c
index 475016d2ea..18019d8930 100644
--- a/audio/filter/af.c
+++ b/audio/filter/af.c
@@ -696,6 +696,17 @@ int af_control_by_label(struct af_stream *s, int cmd, void *arg, bstr label)
}
}
+int af_send_command(struct af_stream *s, char *label, char *cmd, char *arg)
+{
+ char *args[2] = {cmd, arg};
+ if (strcmp(label, "all") == 0) {
+ af_control_all(s, AF_CONTROL_COMMAND, args);
+ return 0;
+ } else {
+ return af_control_by_label(s, AF_CONTROL_COMMAND, args, bstr0(label));
+ }
+}
+
// 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)