[MPlayer-dev-eng] [PATCH]: Add missing memset after malloc in libaf/af_resample.c

Zhou Zongyi zhouzongyi at pset.suntec.net
Wed Mar 4 08:29:30 CET 2009


Hi all,

Currently the resample filter produces junk at the beginning of the audio stream.
This patch fixed the bug by zeroing the circular buffer after it is created.

There is also a typo in comment (bufer). Would someone fix it?

Index: libaf/af_resample.c
===================================================================
--- libaf/af_resample.c (revision 28804)
+++ libaf/af_resample.c (working copy)
@@ -218,8 +218,10 @@
 
     // Create space for circular bufers
     s->xq = malloc(n->nch*sizeof(void*));
-    for(i=0;i<n->nch;i++)
+    for(i=0;i<n->nch;i++) {
       s->xq[i] = malloc(2*L*af->data->bps);
+      memset(s->xq[i],0,2*L*af->data->bps);
+    }
     s->xi = 0;
 
     // Check if the the design needs to be redone


Regards,

Zhou Zongyi


More information about the MPlayer-dev-eng mailing list