summaryrefslogtreecommitdiffstats
path: root/audio/filter/af_center.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-11-12 23:42:04 +0100
committerwm4 <wm4@nowhere>2013-11-12 23:42:04 +0100
commite4bbb1d348dafbb32722f413648006a7bd9d0897 (patch)
tree7165ed9f86a77b751187600d0a9de8b35416f380 /audio/filter/af_center.c
parente4f2fcc0ecd31322df65141edf0ddbff9c075f5d (diff)
parent22b3f522cacfbdba76d311c86efd6091512eb089 (diff)
downloadmpv-e4bbb1d348dafbb32722f413648006a7bd9d0897.tar.bz2
mpv-e4bbb1d348dafbb32722f413648006a7bd9d0897.tar.xz
Merge branch 'planar_audio'
Conflicts: audio/out/ao_lavc.c
Diffstat (limited to 'audio/filter/af_center.c')
-rw-r--r--audio/filter/af_center.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/audio/filter/af_center.c b/audio/filter/af_center.c
index 0cfdbc3b0e..ed482c7a6b 100644
--- a/audio/filter/af_center.c
+++ b/audio/filter/af_center.c
@@ -78,7 +78,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);
}
@@ -87,9 +86,9 @@ static struct mp_audio* play(struct af_instance* af, struct mp_audio* 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
+ float* a = c->planes[0]; // Audio data
int nch = c->nch; // Number of channels
+ int len = c->samples*c->nch; // Number of samples in current audio block
int ch = s->ch; // Channel in which to insert the center audio
register int i;
@@ -108,10 +107,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_center_t));
- if(af->data == NULL || af->setup == NULL)
+ if(af->setup == NULL)
return AF_ERROR;
// Set default values
s->ch = 1; // Channel nr 2