diff options
author | wm4 <wm4@nowhere> | 2015-04-07 21:23:23 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-04-07 21:24:22 +0200 |
commit | 579c4dac34546357a5fd1dfd67712df6a5930bf6 (patch) | |
tree | 917ea7531726635db21fb5c327f13acfd8352368 /audio/filter/af.h | |
parent | e98ab5e596b003b68e44e8c94b5e393e52ed6b6b (diff) | |
download | mpv-579c4dac34546357a5fd1dfd67712df6a5930bf6.tar.bz2 mpv-579c4dac34546357a5fd1dfd67712df6a5930bf6.tar.xz |
audio: change a detail about filter insertion
The af_add() function has a problem: if the inserted filter returns
AF_DETACH during init, the function will have a dangling pointer. Until
now this was avoided by making sure none of the used filters actually
return AF_DETACH, but it's getting infeasible.
Solve this by requiring passing an unique label to af_add(), which is
then used instead of the pointer.
Diffstat (limited to 'audio/filter/af.h')
-rw-r--r-- | audio/filter/af.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/audio/filter/af.h b/audio/filter/af.h index 4c67208123..65a30f7dd1 100644 --- a/audio/filter/af.h +++ b/audio/filter/af.h @@ -141,7 +141,8 @@ struct af_stream *af_new(struct mpv_global *global); void af_destroy(struct af_stream *s); int af_init(struct af_stream *s); void af_uninit(struct af_stream *s); -struct af_instance *af_add(struct af_stream *s, char *name, char **args); +struct af_instance *af_add(struct af_stream *s, char *name, char *label, + char **args); int af_remove_by_label(struct af_stream *s, char *label); struct af_instance *af_find_by_label(struct af_stream *s, char *label); struct af_instance *af_control_any_rev(struct af_stream *s, int cmd, void *arg); |