diff options
author | wm4 <wm4@nowhere> | 2013-12-05 00:01:46 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-12-05 00:01:46 +0100 |
commit | ed024aadb6e7be6c3d910045a64db53a6c95e98f (patch) | |
tree | f26724d268e13ee8ec8f327ea829b65ccd6fab19 /audio/filter/af_sinesuppress.c | |
parent | 2bcfb49a390a928c535cba7cab2b4136f27fceca (diff) | |
download | mpv-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_sinesuppress.c')
-rw-r--r-- | audio/filter/af_sinesuppress.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/audio/filter/af_sinesuppress.c b/audio/filter/af_sinesuppress.c index eee27afd40..c78f209b39 100644 --- a/audio/filter/af_sinesuppress.c +++ b/audio/filter/af_sinesuppress.c @@ -41,7 +41,7 @@ typedef struct af_sinesuppress_s double pos; }af_sinesuppress_t; -static struct mp_audio* play_s16(struct af_instance* af, struct mp_audio* data); +static int play_s16(struct af_instance* af, struct mp_audio* data, int f); //static struct mp_audio* play_float(struct af_instance* af, struct mp_audio* data); // Initialization and runtime control @@ -64,7 +64,7 @@ static int control(struct af_instance* af, int cmd, void* arg) #endif { mp_audio_set_format(af->data, AF_FORMAT_S16); - af->play = play_s16; + af->filter = play_s16; } return af_test_output(af,(struct mp_audio*)arg); @@ -74,7 +74,7 @@ static int control(struct af_instance* af, int cmd, void* arg) } // Filter data through filter -static struct mp_audio* play_s16(struct af_instance* af, struct mp_audio* data) +static int play_s16(struct af_instance* af, struct mp_audio* data, int f) { af_sinesuppress_t *s = af->priv; register int i = 0; @@ -101,7 +101,7 @@ static struct mp_audio* play_s16(struct af_instance* af, struct mp_audio* data) mp_msg(MSGT_AFILTER, MSGL_V, "[sinesuppress] f:%8.2f: amp:%8.2f\n", s->freq, sqrt(s->real*s->real + s->imag*s->imag) / s->ref); - return data; + return 0; } #if 0 @@ -131,7 +131,7 @@ static struct mp_audio* play_float(struct af_instance* af, struct mp_audio* data // Allocate memory and set function pointers static int af_open(struct af_instance* af){ af->control=control; - af->play=play_s16; + af->filter=play_s16; return AF_OK; } |