[Mplayer-cvslog] CVS: main/libaf af.c,1.4,1.5 af_channels.c,1.3,1.4

Anders Johansson anders at mplayerhq.hu
Thu Oct 3 14:43:56 CEST 2002


Update of /cvsroot/mplayer/main/libaf
In directory mail:/var/tmp.root/cvs-serv4792

Modified Files:
	af.c af_channels.c 
Log Message:
Fixing the fix buffer overrun should work now

Index: af.c
===================================================================
RCS file: /cvsroot/mplayer/main/libaf/af.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- af.c	3 Oct 2002 12:02:46 -0000	1.4
+++ af.c	3 Oct 2002 12:43:39 -0000	1.5
@@ -370,7 +370,7 @@
    needed */
 inline int af_lencalc(frac_t mul, af_data_t* d){
   register int t = d->bps*d->nch;
-  return t*(((d->len/t)*mul.n + 1)/mul.d);
+  return t*(((d->len/t)*mul.n)/mul.d + 1);
 }
 
 /* Calculate how long the output from the filters will be given the

Index: af_channels.c
===================================================================
RCS file: /cvsroot/mplayer/main/libaf/af_channels.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- af_channels.c	3 Oct 2002 12:02:46 -0000	1.3
+++ af_channels.c	3 Oct 2002 12:43:39 -0000	1.4
@@ -122,7 +122,7 @@
 
   // Reset unused channels if nch in < nch out
   if(af->mul.n > af->mul.d)
-    memset(l->audio,0,af_lencalc(af->mul, c));
+    memset(l->audio,0,(c->len*af->mul.n)/af->mul.d);
   
   // Special case always output L & R
   if(c->nch == 1){
@@ -143,7 +143,7 @@
   
   // Set output data
   c->audio = l->audio;
-  c->len   = af_lencalc(af->mul, c);
+  c->len   = (c->len*af->mul.n)/af->mul.d;
   c->nch   = l->nch;
 
   return c;




More information about the MPlayer-cvslog mailing list