summaryrefslogtreecommitdiffstats
path: root/audio/filter/af.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-12-05 00:01:46 +0100
committerwm4 <wm4@nowhere>2013-12-05 00:01:46 +0100
commited024aadb6e7be6c3d910045a64db53a6c95e98f (patch)
treef26724d268e13ee8ec8f327ea829b65ccd6fab19 /audio/filter/af.h
parent2bcfb49a390a928c535cba7cab2b4136f27fceca (diff)
downloadmpv-ed024aadb6e7be6c3d910045a64db53a6c95e98f.tar.bz2
mpv-ed024aadb6e7be6c3d910045a64db53a6c95e98f.tar.xz
audio/filter: change filter callback signature
The new signature is actually closer to how it actually works, and someone who is not familiar to the API and how it works might make fewer fatal mistakes with the new signature than the old one. Pretty weird. Do this to sneak in a flags parameter, which will later be used to flush remaining data of at least vf_lavfi.
Diffstat (limited to 'audio/filter/af.h')
-rw-r--r--audio/filter/af.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/audio/filter/af.h b/audio/filter/af.h
index 2d29d3f3ae..fb7f2b3b1d 100644
--- a/audio/filter/af.h
+++ b/audio/filter/af.h
@@ -40,6 +40,9 @@ struct af_instance;
#define AF_FLAGS_REENTRANT 0x00000000
#define AF_FLAGS_NOT_REENTRANT 0x00000001
+// Flags for af->filter()
+#define AF_FILTER_FLAG_EOF 1
+
/* Audio filter information not specific for current instance, but for
a specific filter */
struct af_info {
@@ -58,7 +61,10 @@ struct af_instance {
const struct af_info *info;
int (*control)(struct af_instance *af, int cmd, void *arg);
void (*uninit)(struct af_instance *af);
- struct mp_audio * (*play)(struct af_instance *af, struct mp_audio *data);
+ /* flags is a bit mask of AF_FILTER_FLAG_* values
+ * returns 0 on success, negative value on error
+ */
+ int (*filter)(struct af_instance *af, struct mp_audio *data, int flags);
void *priv;
struct mp_audio *data; // configuration and buffer for outgoing data stream
struct af_instance *next;
@@ -121,7 +127,7 @@ 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 mp_audio *af_play(struct af_stream *s, struct mp_audio *data);
+int af_filter(struct af_stream *s, struct mp_audio *data, int flags);
struct af_instance *af_control_any_rev(struct af_stream *s, int cmd, void *arg);
void af_control_all(struct af_stream *s, int cmd, void *arg);