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

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

mercurial