summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libaf/af.c24
-rw-r--r--libaf/af.h25
-rw-r--r--libaf/af_bs2b.c12
-rw-r--r--libaf/af_center.c12
-rw-r--r--libaf/af_channels.c24
-rw-r--r--libaf/af_delay.c14
-rw-r--r--libaf/af_dummy.c6
-rw-r--r--libaf/af_equalizer.c10
-rw-r--r--libaf/af_export.c12
-rw-r--r--libaf/af_extrastereo.c16
-rw-r--r--libaf/af_format.c36
-rw-r--r--libaf/af_hrtf.c10
-rw-r--r--libaf/af_karaoke.c12
-rw-r--r--libaf/af_ladspa.c10
-rw-r--r--libaf/af_lavcac3enc.c10
-rw-r--r--libaf/af_lavcresample.c8
-rw-r--r--libaf/af_pan.c22
-rw-r--r--libaf/af_resample.c14
-rw-r--r--libaf/af_scaletempo.c12
-rw-r--r--libaf/af_sinesuppress.c16
-rw-r--r--libaf/af_sub.c12
-rw-r--r--libaf/af_surround.c16
-rw-r--r--libaf/af_sweep.c6
-rw-r--r--libaf/af_tools.c4
-rw-r--r--libaf/af_volnorm.c20
-rw-r--r--libaf/af_volume.c14
-rw-r--r--libaf/control.h2
-rw-r--r--libmpcodecs/dec_audio.c4
28 files changed, 191 insertions, 192 deletions
diff --git a/libaf/af.c b/libaf/af.c
index 7596376a99..f2745c5b59 100644
--- a/libaf/af.c
+++ b/libaf/af.c
@@ -240,7 +240,7 @@ void af_remove(af_stream_t* s, af_instance_t* af)
free(af);
}
-static void print_fmt(af_data_t *d)
+static void print_fmt(struct mp_audio *d)
{
if (d) {
mp_msg(MSGT_AFILTER, MSGL_V, "%dHz/%dch/%s", d->rate, d->nch,
@@ -280,7 +280,7 @@ static void af_print_filter_chain(af_stream_t* s)
int af_reinit(af_stream_t* s, af_instance_t* af)
{
do{
- af_data_t in; // Format of the input to current filter
+ struct mp_audio in; // Format of the input to current filter
int rv=0; // Return value
// Check if there are any filters left in the list
@@ -293,9 +293,9 @@ int af_reinit(af_stream_t* s, af_instance_t* af)
// Check if this is the first filter
if(!af->prev)
- memcpy(&in,&(s->input),sizeof(af_data_t));
+ memcpy(&in,&(s->input),sizeof(struct mp_audio));
else
- memcpy(&in,af->prev->data,sizeof(af_data_t));
+ memcpy(&in,af->prev->data,sizeof(struct mp_audio));
// Reset just in case...
in.audio=NULL;
in.len=0;
@@ -319,9 +319,9 @@ int af_reinit(af_stream_t* s, af_instance_t* af)
return rv;
// Initialize channels filter
if(!new->prev)
- memcpy(&in,&(s->input),sizeof(af_data_t));
+ memcpy(&in,&(s->input),sizeof(struct mp_audio));
else
- memcpy(&in,new->prev->data,sizeof(af_data_t));
+ memcpy(&in,new->prev->data,sizeof(struct mp_audio));
if(AF_OK != (rv = new->control(new,AF_CONTROL_REINIT,&in)))
return rv;
}
@@ -336,9 +336,9 @@ int af_reinit(af_stream_t* s, af_instance_t* af)
return rv;
// Initialize format filter
if(!new->prev)
- memcpy(&in,&(s->input),sizeof(af_data_t));
+ memcpy(&in,&(s->input),sizeof(struct mp_audio));
else
- memcpy(&in,new->prev->data,sizeof(af_data_t));
+ memcpy(&in,new->prev->data,sizeof(struct mp_audio));
if(AF_OK != (rv = new->control(new,AF_CONTROL_REINIT,&in)))
return rv;
}
@@ -595,7 +595,7 @@ af_instance_t* af_add(af_stream_t* s, char* name){
}
// Filter data chunk through the filters in the list
-af_data_t* af_play(af_stream_t* s, af_data_t* data)
+struct mp_audio* af_play(af_stream_t* s, struct mp_audio* data)
{
af_instance_t* af=s->first;
// Iterate through all filters
@@ -611,7 +611,7 @@ af_data_t* af_play(af_stream_t* s, af_data_t* data)
* when using the RESIZE_LOCAL_BUFFER macro. The +t+1 part ensures the
* value is >= len*mul rounded upwards to whole samples even if the
* double 'mul' is inexact. */
-int af_lencalc(double mul, af_data_t* d)
+int af_lencalc(double mul, struct mp_audio* d)
{
int t = d->bps * d->nch;
return d->len * mul + t + 1;
@@ -647,7 +647,7 @@ double af_calc_delay(af_stream_t* s)
/* Helper function called by the macro with the same name this
function should not be called directly */
-int af_resize_local_buffer(af_instance_t* af, af_data_t* data)
+int af_resize_local_buffer(af_instance_t* af, struct mp_audio* data)
{
// Calculate new length
register int len = af_lencalc(af->mul,data);
@@ -690,7 +690,7 @@ void af_help (void) {
}
}
-void af_fix_parameters(af_data_t *data)
+void af_fix_parameters(struct mp_audio *data)
{
if (data->nch < 0 || data->nch > AF_NCH) {
mp_msg(MSGT_AFILTER, MSGL_ERR, "Invalid number of channels %i, assuming 2.\n", data->nch);
diff --git a/libaf/af.h b/libaf/af.h
index 4542b32c60..e782759f77 100644
--- a/libaf/af.h
+++ b/libaf/af.h
@@ -37,15 +37,14 @@ struct af_instance_s;
#endif
// Audio data chunk
-typedef struct af_data_s
-{
+struct mp_audio {
void* audio; // data buffer
int len; // buffer length
int rate; // sample rate
int nch; // number of channels
int format; // format
int bps; // bytes per sample
-} af_data_t;
+};
// Flags used for defining the behavior of an audio filter
@@ -70,9 +69,9 @@ typedef struct af_instance_s
af_info_t* info;
int (*control)(struct af_instance_s* af, int cmd, void* arg);
void (*uninit)(struct af_instance_s* af);
- af_data_t* (*play)(struct af_instance_s* af, af_data_t* data);
+ struct mp_audio* (*play)(struct af_instance_s* af, struct mp_audio* data);
void* setup; // setup data for this specific instance and filter
- af_data_t* data; // configuration for outgoing data stream
+ struct mp_audio* data; // configuration for outgoing data stream
struct af_instance_s* next;
struct af_instance_s* prev;
double delay; /* Delay caused by the filter, in units of bytes read without
@@ -113,8 +112,8 @@ typedef struct af_stream
af_instance_t* first;
af_instance_t* last;
// Storage for input and output data formats
- af_data_t input;
- af_data_t output;
+ struct mp_audio input;
+ struct mp_audio output;
// Configuration for this stream
af_cfg_t cfg;
struct MPOpts *opts;
@@ -203,7 +202,7 @@ af_instance_t* af_get(af_stream_t* s, char* name);
* \return resulting data
* \ingroup af_chain
*/
-af_data_t* af_play(af_stream_t* s, af_data_t* data);
+struct mp_audio* af_play(af_stream_t* s, struct mp_audio* data);
/**
* \brief send control to all filters, starting with the last until
@@ -237,12 +236,12 @@ double af_calc_delay(af_stream_t* s);
/* Helper function called by the macro with the same name only to be
called from inside filters */
-int af_resize_local_buffer(af_instance_t* af, af_data_t* data);
+int af_resize_local_buffer(af_instance_t* af, struct mp_audio* data);
/* Helper function used to calculate the exact buffer length needed
when buffers are resized. The returned length is >= than what is
needed */
-int af_lencalc(double mul, af_data_t* data);
+int af_lencalc(double mul, struct mp_audio* data);
/**
* \brief convert dB to gain value
@@ -297,7 +296,7 @@ int af_to_ms(int n, int* in, float* out, int rate);
*
* compares the format, bps, rate and nch values of af->data with out
*/
-int af_test_output(struct af_instance_s* af, af_data_t* out);
+int af_test_output(struct af_instance_s* af, struct mp_audio* out);
/**
* \brief soft clipping function using sin()
@@ -312,13 +311,13 @@ float af_softclip(float a);
void af_help(void);
/**
- * \brief fill the missing parameters in the af_data_t structure
+ * \brief fill the missing parameters in the struct mp_audio structure
* \param data structure to fill
* \ingroup af_filter
*
* Currently only sets bps based on format
*/
-void af_fix_parameters(af_data_t *data);
+void af_fix_parameters(struct mp_audio *data);
/** Memory reallocation macro: if a local buffer is used (i.e. if the
filter doesn't operate on the incoming buffer this macro must be
diff --git a/libaf/af_bs2b.c b/libaf/af_bs2b.c
index 14d31c35be..100ad02aa1 100644
--- a/libaf/af_bs2b.c
+++ b/libaf/af_bs2b.c
@@ -38,7 +38,7 @@ struct af_bs2b {
};
#define PLAY(name, type) \
-static af_data_t *play_##name(struct af_instance_s *af, af_data_t *data) \
+static struct mp_audio *play_##name(struct af_instance_s *af, struct mp_audio *data) \
{ \
/* filter is called for all pairs of samples available in the buffer */ \
bs2b_cross_feed_##name(((struct af_bs2b*)(af->setup))->filter, \
@@ -103,10 +103,10 @@ static int control(struct af_instance_s *af, int cmd, void *arg)
// Sanity check
if (!arg) return AF_ERROR;
- format = ((af_data_t*)arg)->format;
- af->data->rate = ((af_data_t*)arg)->rate;
+ format = ((struct mp_audio*)arg)->format;
+ af->data->rate = ((struct mp_audio*)arg)->rate;
af->data->nch = 2; // bs2b is useful only for 2ch audio
- af->data->bps = ((af_data_t*)arg)->bps;
+ af->data->bps = ((struct mp_audio*)arg)->bps;
af->data->format = format;
/* check for formats supported by libbs2b
@@ -179,7 +179,7 @@ static int control(struct af_instance_s *af, int cmd, void *arg)
mp_msg(MSGT_AFILTER, MSGL_V, "[bs2b] using format %s\n",
af_fmt2str(af->data->format,buf,256));
- return af_test_output(af,(af_data_t*)arg);
+ return af_test_output(af,(struct mp_audio*)arg);
}
case AF_CONTROL_COMMAND_LINE: {
const opt_t subopts[] = {
@@ -243,7 +243,7 @@ static int af_open(af_instance_t *af)
af->control = control;
af->uninit = uninit;
af->mul = 1;
- if (!(af->data = calloc(1, sizeof(af_data_t))))
+ if (!(af->data = calloc(1, sizeof(struct mp_audio))))
return AF_ERROR;
if (!(af->setup = s = calloc(1, sizeof(struct af_bs2b)))) {
free(af->data);
diff --git a/libaf/af_center.c b/libaf/af_center.c
index 1cc3626439..e0897d5e65 100644
--- a/libaf/af_center.c
+++ b/libaf/af_center.c
@@ -47,12 +47,12 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
// Sanity check
if(!arg) return AF_ERROR;
- af->data->rate = ((af_data_t*)arg)->rate;
- af->data->nch = max(s->ch+1,((af_data_t*)arg)->nch);
+ af->data->rate = ((struct mp_audio*)arg)->rate;
+ af->data->nch = max(s->ch+1,((struct mp_audio*)arg)->nch);
af->data->format = AF_FORMAT_FLOAT_NE;
af->data->bps = 4;
- return af_test_output(af,(af_data_t*)arg);
+ return af_test_output(af,(struct mp_audio*)arg);
}
case AF_CONTROL_COMMAND_LINE:{
int ch=1;
@@ -83,9 +83,9 @@ static void uninit(struct af_instance_s* af)
}
// Filter data through filter
-static af_data_t* play(struct af_instance_s* af, af_data_t* data)
+static struct mp_audio* play(struct af_instance_s* af, struct mp_audio* data)
{
- af_data_t* c = data; // Current working data
+ struct mp_audio* c = data; // Current working data
af_center_t* s = af->setup; // Setup for this instance
float* a = c->audio; // Audio data
int len = c->len/4; // Number of samples in current audio block
@@ -109,7 +109,7 @@ static int af_open(af_instance_t* af){
af->uninit=uninit;
af->play=play;
af->mul=1;
- af->data=calloc(1,sizeof(af_data_t));
+ af->data=calloc(1,sizeof(struct mp_audio));
af->setup=s=calloc(1,sizeof(af_center_t));
if(af->data == NULL || af->setup == NULL)
return AF_ERROR;
diff --git a/libaf/af_channels.c b/libaf/af_channels.c
index b42cde380a..671d9aa32a 100644
--- a/libaf/af_channels.c
+++ b/libaf/af_channels.c
@@ -143,11 +143,11 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
if(!s->router){
int i;
// Make sure this filter isn't redundant
- if(af->data->nch == ((af_data_t*)arg)->nch)
+ if(af->data->nch == ((struct mp_audio*)arg)->nch)
return AF_DETACH;
// If mono: fake stereo
- if(((af_data_t*)arg)->nch == 1){
+ if(((struct mp_audio*)arg)->nch == 1){
s->nr = min(af->data->nch,2);
for(i=0;i<s->nr;i++){
s->route[i][FR] = 0;
@@ -155,7 +155,7 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
}
}
else{
- s->nr = min(af->data->nch, ((af_data_t*)arg)->nch);
+ s->nr = min(af->data->nch, ((struct mp_audio*)arg)->nch);
for(i=0;i<s->nr;i++){
s->route[i][FR] = i;
s->route[i][TO] = i;
@@ -163,11 +163,11 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
}
}
- af->data->rate = ((af_data_t*)arg)->rate;
- af->data->format = ((af_data_t*)arg)->format;
- af->data->bps = ((af_data_t*)arg)->bps;
- af->mul = (double)af->data->nch / ((af_data_t*)arg)->nch;
- return check_routes(s,((af_data_t*)arg)->nch,af->data->nch);
+ af->data->rate = ((struct mp_audio*)arg)->rate;
+ af->data->format = ((struct mp_audio*)arg)->format;
+ af->data->bps = ((struct mp_audio*)arg)->bps;
+ af->mul = (double)af->data->nch / ((struct mp_audio*)arg)->nch;
+ return check_routes(s,((struct mp_audio*)arg)->nch,af->data->nch);
case AF_CONTROL_COMMAND_LINE:{
int nch = 0;
int n = 0;
@@ -256,10 +256,10 @@ static void uninit(struct af_instance_s* af)
}
// Filter data through filter
-static af_data_t* play(struct af_instance_s* af, af_data_t* data)
+static struct mp_audio* play(struct af_instance_s* af, struct mp_audio* data)
{
- af_data_t* c = data; // Current working data
- af_data_t* l = af->data; // Local data
+ struct mp_audio* c = data; // Current working data
+ struct mp_audio* l = af->data; // Local data
af_channels_t* s = af->setup;
int i;
@@ -288,7 +288,7 @@ static int af_open(af_instance_t* af){
af->uninit=uninit;
af->play=play;
af->mul=1;
- af->data=calloc(1,sizeof(af_data_t));
+ af->data=calloc(1,sizeof(struct mp_audio));
af->setup=calloc(1,sizeof(af_channels_t));
if((af->data == NULL) || (af->setup == NULL))
return AF_ERROR;
diff --git a/libaf/af_delay.c b/libaf/af_delay.c
index f0a9704eaa..15e0c7071f 100644
--- a/libaf/af_delay.c
+++ b/libaf/af_delay.c
@@ -52,10 +52,10 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
for(i=0;i<af->data->nch;i++)
free(s->q[i]);
- af->data->rate = ((af_data_t*)arg)->rate;
- af->data->nch = ((af_data_t*)arg)->nch;
- af->data->format = ((af_data_t*)arg)->format;
- af->data->bps = ((af_data_t*)arg)->bps;
+ af->data->rate = ((struct mp_audio*)arg)->rate;
+ af->data->nch = ((struct mp_audio*)arg)->nch;
+ af->data->format = ((struct mp_audio*)arg)->format;
+ af->data->bps = ((struct mp_audio*)arg)->bps;
// Allocate new delay queues
for(i=0;i<af->data->nch;i++){
@@ -118,9 +118,9 @@ static void uninit(struct af_instance_s* af)
}
// Filter data through filter
-static af_data_t* play(struct af_instance_s* af, af_data_t* data)
+static struct mp_audio* play(struct af_instance_s* af, struct mp_audio* data)
{
- af_data_t* c = data; // Current working data
+ struct mp_audio* c = data; // Current working data
af_delay_t* s = af->setup; // Setup for this instance
int nch = c->nch; // Number of channels
int len = c->len/c->bps; // Number of sample in data chunk
@@ -182,7 +182,7 @@ static int af_open(af_instance_t* af){
af->uninit=uninit;
af->play=play;
af->mul=1;
- af->data=calloc(1,sizeof(af_data_t));
+ af->data=calloc(1,sizeof(struct mp_audio));
af->setup=calloc(1,sizeof(af_delay_t));
if(af->data == NULL || af->setup == NULL)
return AF_ERROR;
diff --git a/libaf/af_dummy.c b/libaf/af_dummy.c
index ba921eb09b..26aa9b5e22 100644
--- a/libaf/af_dummy.c
+++ b/libaf/af_dummy.c
@@ -30,7 +30,7 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
{
switch(cmd){
case AF_CONTROL_REINIT:
- memcpy(af->data,(af_data_t*)arg,sizeof(af_data_t));
+ memcpy(af->data,(struct mp_audio*)arg,sizeof(struct mp_audio));
mp_msg(MSGT_AFILTER, MSGL_V, "[dummy] Was reinitialized: %iHz/%ich/%s\n",
af->data->rate,af->data->nch,af_fmt2str_short(af->data->format));
return AF_OK;
@@ -45,7 +45,7 @@ static void uninit(struct af_instance_s* af)
}
// Filter data through filter
-static af_data_t* play(struct af_instance_s* af, af_data_t* data)
+static struct mp_audio* play(struct af_instance_s* af, struct mp_audio* data)
{
// Do something necessary to get rid of annoying warning during compile
if(!af)
@@ -59,7 +59,7 @@ static int af_open(af_instance_t* af){
af->uninit=uninit;
af->play=play;
af->mul=1;
- af->data=malloc(sizeof(af_data_t));
+ af->data=malloc(sizeof(struct mp_audio));
if(af->data == NULL)
return AF_ERROR;
return AF_OK;
diff --git a/libaf/af_equalizer.c b/libaf/af_equalizer.c
index 318b7a72d0..112926dee6 100644
--- a/libaf/af_equalizer.c
+++ b/libaf/af_equalizer.c
@@ -96,8 +96,8 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
// Sanity check
if(!arg) return AF_ERROR;
- af->data->rate = ((af_data_t*)arg)->rate;
- af->data->nch = ((af_data_t*)arg)->nch;
+ af->data->rate = ((struct mp_audio*)arg)->rate;
+ af->data->nch = ((struct mp_audio*)arg)->nch;
af->data->format = AF_FORMAT_FLOAT_NE;
af->data->bps = 4;
@@ -186,9 +186,9 @@ static void uninit(struct af_instance_s* af)
}
// Filter data through filter
-static af_data_t* play(struct af_instance_s* af, af_data_t* data)
+static struct mp_audio* play(struct af_instance_s* af, struct mp_audio* data)
{
- af_data_t* c = data; // Current working data
+ struct mp_audio* c = data; // Current working data
af_equalizer_t* s = (af_equalizer_t*)af->setup; // Setup
uint32_t ci = af->data->nch; // Index for channels
uint32_t nch = af->data->nch; // Number of channels
@@ -230,7 +230,7 @@ static int af_open(af_instance_t* af){
af->uninit=uninit;
af->play=play;
af->mul=1;
- af->data=calloc(1,sizeof(af_data_t));
+ af->data=calloc(1,sizeof(struct mp_audio));
af->setup=calloc(1,sizeof(af_equalizer_t));
if(af->data == NULL || af->setup == NULL)
return AF_ERROR;
diff --git a/libaf/af_export.c b/libaf/af_export.c
index b5e5a884c0..0239791905 100644
--- a/libaf/af_export.c
+++ b/libaf/af_export.c
@@ -84,8 +84,8 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
close(s->fd);
// Accept only int16_t as input format (which sucks)
- af->data->rate = ((af_data_t*)arg)->rate;
- af->data->nch = ((af_data_t*)arg)->nch;
+ af->data->rate = ((struct mp_audio*)arg)->rate;
+ af->data->nch = ((struct mp_audio*)arg)->nch;
af->data->format = AF_FORMAT_S16_NE;
af->data->bps = 2;
@@ -129,7 +129,7 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
msync(s->mmap_area, mapsize, MS_ASYNC);
// Use test_output to return FALSE if necessary
- return af_test_output(af, (af_data_t*)arg);
+ return af_test_output(af, (struct mp_audio*)arg);
}
case AF_CONTROL_COMMAND_LINE:{
int i=0;
@@ -201,9 +201,9 @@ static void uninit( struct af_instance_s* af )
af audio filter instance
data audio data
*/
-static af_data_t* play( struct af_instance_s* af, af_data_t* data )
+static struct mp_audio* play( struct af_instance_s* af, struct mp_audio* data )
{
- af_data_t* c = data; // Current working data
+ struct mp_audio* c = data; // Current working data
af_export_t* s = af->setup; // Setup for this instance
int16_t* a = c->audio; // Incomming sound
int nch = c->nch; // Number of channels
@@ -252,7 +252,7 @@ static int af_open( af_instance_t* af )
af->uninit = uninit;
af->play = play;
af->mul=1;
- af->data = calloc(1, sizeof(af_data_t));
+ af->data = calloc(1, sizeof(struct mp_audio));
af->setup = calloc(1, sizeof(af_export_t));
if((af->data == NULL) || (af->setup == NULL))
return AF_ERROR;
diff --git a/libaf/af_extrastereo.c b/libaf/af_extrastereo.c
index 347c257137..c1ae719c31 100644
--- a/libaf/af_extrastereo.c
+++ b/libaf/af_extrastereo.c
@@ -34,8 +34,8 @@ typedef struct af_extrastereo_s
float mul;
}af_extrastereo_t;
-static af_data_t* play_s16(struct af_instance_s* af, af_data_t* data);
-static af_data_t* play_float(struct af_instance_s* af, af_data_t* data);
+static struct mp_audio* play_s16(struct af_instance_s* af, struct mp_audio* data);
+static struct mp_audio* play_float(struct af_instance_s* af, struct mp_audio* data);
// Initialization and runtime control
static int control(struct af_instance_s* af, int cmd, void* arg)
@@ -47,9 +47,9 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
// Sanity check
if(!arg) return AF_ERROR;
- af->data->rate = ((af_data_t*)arg)->rate;
+ af->data->rate = ((struct mp_audio*)arg)->rate;
af->data->nch = 2;
- if (((af_data_t*)arg)->format == AF_FORMAT_FLOAT_NE)
+ if (((struct mp_audio*)arg)->format == AF_FORMAT_FLOAT_NE)
{
af->data->format = AF_FORMAT_FLOAT_NE;
af->data->bps = 4;
@@ -61,7 +61,7 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
af->play = play_s16;
}
- return af_test_output(af,(af_data_t*)arg);
+ return af_test_output(af,(struct mp_audio*)arg);
}
case AF_CONTROL_COMMAND_LINE:{
float f;
@@ -87,7 +87,7 @@ static void uninit(struct af_instance_s* af)
}
// Filter data through filter
-static af_data_t* play_s16(struct af_instance_s* af, af_data_t* data)
+static struct mp_audio* play_s16(struct af_instance_s* af, struct mp_audio* data)
{
af_extrastereo_t *s = af->setup;
register int i = 0;
@@ -109,7 +109,7 @@ static af_data_t* play_s16(struct af_instance_s* af, af_data_t* data)
return data;
}
-static af_data_t* play_float(struct af_instance_s* af, af_data_t* data)
+static struct mp_audio* play_float(struct af_instance_s* af, struct mp_audio* data)
{
af_extrastereo_t *s = af->setup;
register int i = 0;
@@ -137,7 +137,7 @@ static int af_open(af_instance_t* af){
af->uninit=uninit;
af->play=play_s16;
af->mul=1;
- af->data=calloc(1,sizeof(af_data_t));
+ af->data=calloc(1,sizeof(struct mp_audio));
af->setup=calloc(1,sizeof(af_extrastereo_t));
if(af->data == NULL || af->setup == NULL)
return AF_ERROR;
diff --git a/libaf/af_format.c b/libaf/af_format.c
index ea9f39e2e6..a9d1fe6c88 100644
--- a/libaf/af_format.c
+++ b/libaf/af_format.c
@@ -52,10 +52,10 @@ static void float2int(float* in, void* out, int len, int bps);
// From signed int to float
static void int2float(void* in, float* out, int len, int bps);
-static af_data_t* play(struct af_instance_s* af, af_data_t* data);
-static af_data_t* play_swapendian(struct af_instance_s* af, af_data_t* data);
-static af_data_t* play_float_s16(struct af_instance_s* af, af_data_t* data);
-static af_data_t* play_s16_float(struct af_instance_s* af, af_data_t* data);
+static struct mp_audio* play(struct af_instance_s* af, struct mp_audio* data);
+static struct mp_audio* play_swapendian(struct af_instance_s* af, struct mp_audio* data);
+static struct mp_audio* play_float_s16(struct af_instance_s* af, struct mp_audio* data);
+static struct mp_audio* play_s16_float(struct af_instance_s* af, struct mp_audio* data);
// Helper functions to check sanity for input arguments
@@ -92,7 +92,7 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
case AF_CONTROL_REINIT:{
char buf1[256];
char buf2[256];
- af_data_t *data = arg;
+ struct mp_audio *data = arg;
// Make sure this filter isn't redundant
if(af->data->format == data->format &&
@@ -176,10 +176,10 @@ static void uninit(struct af_instance_s* af)
af->setup = 0;
}
-static af_data_t* play_swapendian(struct af_instance_s* af, af_data_t* data)
+static struct mp_audio* play_swapendian(struct af_instance_s* af, struct mp_audio* data)
{
- af_data_t* l = af->data; // Local data
- af_data_t* c = data; // Current working data
+ struct mp_audio* l = af->data; // Local data
+ struct mp_audio* c = data; // Current working data
int len = c->len/c->bps; // Length in samples of current audio block
if(AF_OK != RESIZE_LOCAL_BUFFER(af,data))
@@ -193,10 +193,10 @@ static af_data_t* play_swapendian(struct af_instance_s* af, af_data_t* data)
return c;
}
-static af_data_t* play_float_s16(struct af_instance_s* af, af_data_t* data)
+static struct mp_audio* play_float_s16(struct af_instance_s* af, struct mp_audio* data)
{
- af_data_t* l = af->data; // Local data
- af_data_t* c = data; // Current working data
+ struct mp_audio* l = af->data; // Local data
+ struct mp_audio* c = data; // Current working data
int len = c->len/4; // Length in samples of current audio block
if(AF_OK != RESIZE_LOCAL_BUFFER(af,data))
@@ -212,10 +212,10 @@ static af_data_t* play_float_s16(struct af_instance_s* af, af_data_t* data)
return c;
}
-static af_data_t* play_s16_float(struct af_instance_s* af, af_data_t* data)
+static struct mp_audio* play_s16_float(struct af_instance_s* af, struct mp_audio* data)
{
- af_data_t* l = af->data; // Local data
- af_data_t* c = data; // Current working data
+ struct mp_audio* l = af->data; // Local data
+ struct mp_audio* c = data; // Current working data
int len = c->len/2; // Length in samples of current audio block
if(AF_OK != RESIZE_LOCAL_BUFFER(af,data))
@@ -232,10 +232,10 @@ static af_data_t* play_s16_float(struct af_instance_s* af, af_data_t* data)
}
// Filter data through filter
-static af_data_t* play(struct af_instance_s* af, af_data_t* data)
+static struct mp_audio* play(struct af_instance_s* af, struct mp_audio* data)
{
- af_data_t* l = af->data; // Local data
- af_data_t* c = data; // Current working data
+ struct mp_audio* l = af->data; // Local data
+ struct mp_audio* c = data; // Current working data
int len = c->len/c->bps; // Length in samples of current audio block
if(AF_OK != RESIZE_LOCAL_BUFFER(af,data))
@@ -318,7 +318,7 @@ static int af_open(af_instance_t* af){
af->uninit=uninit;
af->play=play;
af->mul=1;
- af->data=calloc(1,sizeof(af_data_t));
+ af->data=calloc(1,sizeof(struct mp_audio));
if(af->data == NULL)
return AF_ERROR;
return AF_OK;
diff --git a/libaf/af_hrtf.c b/libaf/af_hrtf.c
index 4edf224de9..1aab8adcf6 100644
--- a/libaf/af_hrtf.c
+++ b/libaf/af_hrtf.c
@@ -290,7 +290,7 @@ static int control(struct af_instance_s *af, int cmd, void* arg)
switch(cmd) {
case AF_CONTROL_REINIT:
- af->data->rate = ((af_data_t*)arg)->rate;
+ af->data->rate = ((struct mp_audio*)arg)->rate;
if(af->data->rate != 48000) {
// automatic samplerate adjustment in the filter chain
// is not yet supported.
@@ -299,7 +299,7 @@ static int control(struct af_instance_s *af, int cmd, void* arg)
af->data->rate);
return AF_ERROR;
}
- af->data->nch = ((af_data_t*)arg)->nch;
+ af->data->nch = ((struct mp_audio*)arg)->nch;
if(af->data->nch == 2) {
/* 2 channel input */
if(s->decode_mode != HRTF_MIX_MATRIX2CH) {
@@ -311,7 +311,7 @@ static int control(struct af_instance_s *af, int cmd, void* arg)
af->data->nch = 5;
af->data->format = AF_FORMAT_S16_NE;
af->data->bps = 2;
- test_output_res = af_test_output(af, (af_data_t*)arg);
+ test_output_res = af_test_output(af, (struct mp_audio*)arg);
af->mul = 2.0 / af->data->nch;
// after testing input set the real output format
af->data->nch = 2;
@@ -381,7 +381,7 @@ frequencies).
2. A bass compensation is introduced to ensure that 0-200 Hz are not
damped (without any real 3D acoustical image, however).
*/
-static af_data_t* play(struct af_instance_s *af, af_data_t *data)
+static struct mp_audio* play(struct af_instance_s *af, struct mp_audio *data)
{
af_hrtf_t *s = af->setup;
short *in = data->audio; // Input audio data
@@ -603,7 +603,7 @@ static int af_open(af_instance_t* af)
af->uninit = uninit;
af->play = play;
af->mul = 1;
- af->data = calloc(1, sizeof(af_data_t));
+ af->data = calloc(1, sizeof(struct mp_audio));
af->setup = calloc(1, sizeof(af_hrtf_t));
if((af->data == NULL) || (af->setup == NULL))
return AF_ERROR;
diff --git a/libaf/af_karaoke.c b/libaf/af_karaoke.c
index 780349dfee..1e8e313fa9 100644
--- a/libaf/af_karaoke.c
+++ b/libaf/af_karaoke.c
@@ -34,11 +34,11 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
{
switch(cmd){
case AF_CONTROL_REINIT:
- af->data->rate = ((af_data_t*)arg)->rate;
- af->data->nch = ((af_data_t*)arg)->nch;
+ af->data->rate = ((struct mp_audio*)arg)->rate;
+ af->data->nch = ((struct mp_audio*)arg)->nch;
af->data->format= AF_FORMAT_FLOAT_NE;
af->data->bps = 4;
- return af_test_output(af,(af_data_t*)arg);
+ return af_test_output(af,(struct mp_audio*)arg);
}
return AF_UNKNOWN;
}
@@ -50,9 +50,9 @@ static void uninit(struct af_instance_s* af)
}
// Filter data through filter
-static af_data_t* play(struct af_instance_s* af, af_data_t* data)
+static struct mp_audio* play(struct af_instance_s* af, struct mp_audio* data)
{
- af_data_t* c