summaryrefslogtreecommitdiffstats
path: root/audio/filter/af_extrastereo.c
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_extrastereo.c
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_extrastereo.c')
-rw-r--r--audio/filter/af_extrastereo.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/audio/filter/af_extrastereo.c b/audio/filter/af_extrastereo.c
index ed05941ece..92cc4dd216 100644
--- a/audio/filter/af_extrastereo.c
+++ b/audio/filter/af_extrastereo.c
@@ -35,8 +35,8 @@ typedef struct af_extrastereo_s
float mul;
}af_extrastereo_t;
-static struct mp_audio* play_s16(struct af_instance* af, struct mp_audio* data);
-static struct mp_audio* play_float(struct af_instance* af, struct mp_audio* data);
+static int play_s16(struct af_instance* af, struct mp_audio* data, int f);
+static int play_float(struct af_instance* af, struct mp_audio* data, int f);
// Initialization and runtime control
static int control(struct af_instance* af, int cmd, void* arg)
@@ -51,11 +51,11 @@ static int control(struct af_instance* af, int cmd, void* arg)
mp_audio_set_num_channels(af->data, 2);
if (af->data->format == AF_FORMAT_FLOAT)
{
- af->play = play_float;
+ af->filter = play_float;
}// else
{
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);
@@ -65,7 +65,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_extrastereo_t *s = af->priv;
register int i = 0;
@@ -84,10 +84,10 @@ static struct mp_audio* play_s16(struct af_instance* af, struct mp_audio* data)
a[i + 1] = MPCLAMP(r, SHRT_MIN, SHRT_MAX);
}
- return data;
+ return 0;
}
-static struct mp_audio* play_float(struct af_instance* af, struct mp_audio* data)
+static int play_float(struct af_instance* af, struct mp_audio* data, int f)
{
af_extrastereo_t *s = af->priv;
register int i = 0;
@@ -106,13 +106,13 @@ static struct mp_audio* play_float(struct af_instance* af, struct mp_audio* data
a[i + 1] = af_softclip(r);
}
- return data;
+ return 0;
}
// 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;
}