[xiph-commits] r12419 - trunk/speex/libspeex

jm at svn.xiph.org jm at svn.xiph.org
Sat Feb 3 04:50:59 PST 2007


Author: jm
Date: 2007-02-03 04:50:57 -0800 (Sat, 03 Feb 2007)
New Revision: 12419

Modified:
   trunk/speex/libspeex/resample.c
Log:
New, improved. Now with 100% less memory corruption.


Modified: trunk/speex/libspeex/resample.c
===================================================================
--- trunk/speex/libspeex/resample.c	2007-02-03 12:38:59 UTC (rev 12418)
+++ trunk/speex/libspeex/resample.c	2007-02-03 12:50:57 UTC (rev 12419)
@@ -265,7 +265,7 @@
       {
          int j;
          /* Copy data going backward */
-         for (j=0;j<old_length-1;j++)
+         for (j=0;j<st->filt_len-1+st->magic_samples;j++)
             st->mem[i*st->mem_alloc_size+j] = st->mem[i*st->mem_alloc_size+j+st->magic_samples];
       }
    }
@@ -334,7 +334,7 @@
       /* magic_samples needs to be set to zero to avoid infinite recursion */
       st->magic_samples = 0;
       speex_resampler_process_native(st, channel_index, mem+N-1, &tmp_in_len, out, &tmp_out_len);
-      speex_warning_int("extra samples:", tmp_out_len);
+      /*speex_warning_int("extra samples:", tmp_out_len);*/
       out += tmp_out_len;
    }
    while (!(st->last_sample >= *in_len || out_sample >= *out_len))



More information about the commits mailing list