[pulseaudio-discuss] [PATCH] resampler: Fix peaks resampler's channel handling
Damir Jelić
poljarinho at gmail.com
Wed Jul 10 11:53:43 PDT 2013
On Wed, Jul 10, 2013 at 09:48:40PM +0300, Tanu Kaskinen wrote:
> In the resampling phase the input and output data have the same number
> of channels (o_ss.channels).
Isn't work_channels used to represent the number of channels in the
resampling phase?
> ---
> src/pulsecore/resampler.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/pulsecore/resampler.c b/src/pulsecore/resampler.c
> index cdfaf8f..341d85b 100644
> --- a/src/pulsecore/resampler.c
> +++ b/src/pulsecore/resampler.c
> @@ -1526,7 +1526,7 @@ static void peaks_resample(pa_resampler *r, const pa_memchunk *input, unsigned i
> o_index++, r->peaks.o_counter++;
> }
> } else if (r->work_format == PA_SAMPLE_S16NE) {
> - int16_t *s = (int16_t*) src + r->i_ss.channels * i;
> + int16_t *s = (int16_t*) src + r->o_ss.channels * i;
> int16_t *d = (int16_t*) dst + r->o_ss.channels * o_index;
>
> for (; i < i_end && i < in_n_frames; i++)
> @@ -1545,7 +1545,7 @@ static void peaks_resample(pa_resampler *r, const pa_memchunk *input, unsigned i
> o_index++, r->peaks.o_counter++;
> }
> } else {
> - float *s = (float*) src + r->i_ss.channels * i;
> + float *s = (float*) src + r->o_ss.channels * i;
> float *d = (float*) dst + r->o_ss.channels * o_index;
>
> for (; i < i_end && i < in_n_frames; i++)
> --
> 1.8.1.2
>
> _______________________________________________
> pulseaudio-discuss mailing list
> pulseaudio-discuss at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss
More information about the pulseaudio-discuss
mailing list