media/libspeex_resampler/reset.patch

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/media/libspeex_resampler/reset.patch	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,35 @@
     1.4 +# HG changeset patch
     1.5 +# Parent b65da7e13aaee4756135be04016e081a95e86855
     1.6 +# User Karl Tomlinson <karlt+@karlt.net>
     1.7 +b=973374 complete speex_resampler_reset_mem r=jmspeex
     1.8 +
     1.9 +sample_frac_num is the array most likely to be non-zero after resampling a
    1.10 +previous stream, but the other arrays can also be left at non-zero values
    1.11 +in other situations.
    1.12 +
    1.13 +diff --git a/media/libspeex_resampler/src/resample.c b/media/libspeex_resampler/src/resample.c
    1.14 +--- a/media/libspeex_resampler/src/resample.c
    1.15 ++++ b/media/libspeex_resampler/src/resample.c
    1.16 +@@ -1141,16 +1141,22 @@ SPX_RESAMPLE_EXPORT int speex_resampler_
    1.17 +    for (i=0;i<st->nb_channels;i++)
    1.18 +       st->last_sample[i] = st->filt_len/2;
    1.19 +    return RESAMPLER_ERR_SUCCESS;
    1.20 + }
    1.21 + 
    1.22 + SPX_RESAMPLE_EXPORT int speex_resampler_reset_mem(SpeexResamplerState *st)
    1.23 + {
    1.24 +    spx_uint32_t i;
    1.25 ++   for (i=0;i<st->nb_channels;i++)
    1.26 ++   {
    1.27 ++      st->last_sample[i] = 0;
    1.28 ++      st->magic_samples[i] = 0;
    1.29 ++      st->samp_frac_num[i] = 0;
    1.30 ++   }
    1.31 +    for (i=0;i<st->nb_channels*(st->filt_len-1);i++)
    1.32 +       st->mem[i] = 0;
    1.33 +    return RESAMPLER_ERR_SUCCESS;
    1.34 + }
    1.35 + 
    1.36 + SPX_RESAMPLE_EXPORT const char *speex_resampler_strerror(int err)
    1.37 + {
    1.38 +    switch (err)

mercurial