media/libspeex_resampler/reset.patch

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 # HG changeset patch
michael@0 2 # Parent b65da7e13aaee4756135be04016e081a95e86855
michael@0 3 # User Karl Tomlinson <karlt+@karlt.net>
michael@0 4 b=973374 complete speex_resampler_reset_mem r=jmspeex
michael@0 5
michael@0 6 sample_frac_num is the array most likely to be non-zero after resampling a
michael@0 7 previous stream, but the other arrays can also be left at non-zero values
michael@0 8 in other situations.
michael@0 9
michael@0 10 diff --git a/media/libspeex_resampler/src/resample.c b/media/libspeex_resampler/src/resample.c
michael@0 11 --- a/media/libspeex_resampler/src/resample.c
michael@0 12 +++ b/media/libspeex_resampler/src/resample.c
michael@0 13 @@ -1141,16 +1141,22 @@ SPX_RESAMPLE_EXPORT int speex_resampler_
michael@0 14 for (i=0;i<st->nb_channels;i++)
michael@0 15 st->last_sample[i] = st->filt_len/2;
michael@0 16 return RESAMPLER_ERR_SUCCESS;
michael@0 17 }
michael@0 18
michael@0 19 SPX_RESAMPLE_EXPORT int speex_resampler_reset_mem(SpeexResamplerState *st)
michael@0 20 {
michael@0 21 spx_uint32_t i;
michael@0 22 + for (i=0;i<st->nb_channels;i++)
michael@0 23 + {
michael@0 24 + st->last_sample[i] = 0;
michael@0 25 + st->magic_samples[i] = 0;
michael@0 26 + st->samp_frac_num[i] = 0;
michael@0 27 + }
michael@0 28 for (i=0;i<st->nb_channels*(st->filt_len-1);i++)
michael@0 29 st->mem[i] = 0;
michael@0 30 return RESAMPLER_ERR_SUCCESS;
michael@0 31 }
michael@0 32
michael@0 33 SPX_RESAMPLE_EXPORT const char *speex_resampler_strerror(int err)
michael@0 34 {
michael@0 35 switch (err)

mercurial