media/libspeex_resampler/reset.patch

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

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