summaryrefslogtreecommitdiffstats
path: root/audio/filter/af_sub.c
diff options
context:
space:
mode:
Diffstat (limited to 'audio/filter/af_sub.c')
-rw-r--r--audio/filter/af_sub.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/audio/filter/af_sub.c b/audio/filter/af_sub.c
index 7778e80b64..4fd16904c9 100644
--- a/audio/filter/af_sub.c
+++ b/audio/filter/af_sub.c
@@ -123,7 +123,6 @@ static int control(struct af_instance* af, int cmd, void* arg)
// Deallocate memory
static void uninit(struct af_instance* af)
{
- free(af->data);
free(af->setup);
}
@@ -143,8 +142,8 @@ static struct mp_audio* play(struct af_instance* af, struct mp_audio* data)
{
struct mp_audio* c = data; // Current working data
af_sub_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
+ float* a = c->planes[0]; // Audio data
+ int len = c->samples*c->nch; // Number of samples in current audio block
int nch = c->nch; // Number of channels
int ch = s->ch; // Channel in which to insert the sub audio
register int i;
@@ -166,10 +165,8 @@ static int af_open(struct af_instance* af){
af->control=control;
af->uninit=uninit;
af->play=play;
- af->mul=1;
- af->data=calloc(1,sizeof(struct mp_audio));
af->setup=s=calloc(1,sizeof(af_sub_t));
- if(af->data == NULL || af->setup == NULL)
+ if(af->setup == NULL)
return AF_ERROR;
// Set default values
s->ch = 5; // Channel nr 6