michael@0: # HG changeset patch michael@0: # Parent b65da7e13aaee4756135be04016e081a95e86855 michael@0: # User Karl Tomlinson michael@0: b=973374 complete speex_resampler_reset_mem r=jmspeex michael@0: michael@0: sample_frac_num is the array most likely to be non-zero after resampling a michael@0: previous stream, but the other arrays can also be left at non-zero values michael@0: in other situations. michael@0: michael@0: diff --git a/media/libspeex_resampler/src/resample.c b/media/libspeex_resampler/src/resample.c michael@0: --- a/media/libspeex_resampler/src/resample.c michael@0: +++ b/media/libspeex_resampler/src/resample.c michael@0: @@ -1141,16 +1141,22 @@ SPX_RESAMPLE_EXPORT int speex_resampler_ michael@0: for (i=0;inb_channels;i++) michael@0: st->last_sample[i] = st->filt_len/2; michael@0: return RESAMPLER_ERR_SUCCESS; michael@0: } michael@0: michael@0: SPX_RESAMPLE_EXPORT int speex_resampler_reset_mem(SpeexResamplerState *st) michael@0: { michael@0: spx_uint32_t i; michael@0: + for (i=0;inb_channels;i++) michael@0: + { michael@0: + st->last_sample[i] = 0; michael@0: + st->magic_samples[i] = 0; michael@0: + st->samp_frac_num[i] = 0; michael@0: + } michael@0: for (i=0;inb_channels*(st->filt_len-1);i++) michael@0: st->mem[i] = 0; michael@0: return RESAMPLER_ERR_SUCCESS; michael@0: } michael@0: michael@0: SPX_RESAMPLE_EXPORT const char *speex_resampler_strerror(int err) michael@0: { michael@0: switch (err)