Hi Fahad. Please don't put the whole commit message into the subject of the commit, here are some useful commit message guidelines: https://www.mediawiki.org/wiki/Gerrit/Commit_message_guidelines On Mon, Dec 23, 2013 at 11:09:17PM +0500, Fahad Arslan wrote: > From: Fahad Arslan <Fahad_Arslan at mentor.com> > > Signed-off-by: Fahad Arslan <Fahad_Arslan at mentor.com> > --- > src/pulsecore/resampler.c | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/src/pulsecore/resampler.c b/src/pulsecore/resampler.c > index f0c663f..34bdfc3 100644 > --- a/src/pulsecore/resampler.c > +++ b/src/pulsecore/resampler.c > @@ -1435,7 +1435,7 @@ static int libsamplerate_init(pa_resampler *r) { > > static unsigned speex_resample_float(pa_resampler *r, const pa_memchunk *input, unsigned in_n_frames, pa_memchunk *output, unsigned *out_n_frames) { > float *in, *out; > - uint32_t inf = in_n_frames, outf = *out_n_frames; > + uint32_t inf = in_n_frames, outf = *out_n_frames, i; > SpeexResamplerState *state; > > pa_assert(r); > @@ -1448,6 +1448,11 @@ static unsigned speex_resample_float(pa_resampler *r, const pa_memchunk *input, > in = pa_memblock_acquire_chunk(input); > out = pa_memblock_acquire_chunk(output); > > + /* Speex float API scale range is +/-32768 instead of +/-1. > + So rescale input before passing it to Speex. */ > + for (i = 0; i < inf; i++) > + in[i] = 32768.*in[i]; This breaks speex-float if it isn't compiled with FIXED_POINT defined (most desktop machines don't use FIXED_POINT), also I think that this kind of logic should go into the choose_work_format() function inside of resampler.c, no? > + Trailing whitespace. > pa_assert_se(speex_resampler_process_interleaved_float(state, in, &inf, out, &outf) == 0); > > pa_memblock_release(input->memblock); > -- > 1.7.9.5 >