From d5725f46d95776832afbeef87ac32bf40032019a Mon Sep 17 00:00:00 2001 From: Michael Gernoth Date: Thu, 26 Oct 2006 22:26:16 +0000 Subject: [PATCH] small fix to the (still disabled) linear resampler git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@1302 423420c4-83ab-492f-b58f-81f9feb106b5 --- rdpsnd_dsp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rdpsnd_dsp.c b/rdpsnd_dsp.c index 8190fa0..0b025bd 100644 --- a/rdpsnd_dsp.c +++ b/rdpsnd_dsp.c @@ -308,7 +308,7 @@ rdpsnd_dsp_resample(unsigned char **out, unsigned char *in, unsigned int size, if (source * resample_to_channels + samplewidth > size) break; -#if 0 /* Linear resampling, TODO: soundquality fixes */ +#if 0 /* Linear resampling, TODO: soundquality fixes (LP filter) */ if (samplewidth == 1) { sint8 cval1, cval2; @@ -321,7 +321,7 @@ rdpsnd_dsp_resample(unsigned char **out, unsigned char *in, unsigned int size, in + ((source + 1) * resample_to_channels * samplewidth) + (samplewidth * j), samplewidth); - cval1 += (cval2 * part) / 100; + cval1 += (sint8)(cval2 * part) / 100; memcpy(*out + (i * resample_to_channels * samplewidth) + (samplewidth * j), &cval1, samplewidth); @@ -339,7 +339,7 @@ rdpsnd_dsp_resample(unsigned char **out, unsigned char *in, unsigned int size, in + ((source + 1) * resample_to_channels * samplewidth) + (samplewidth * j), samplewidth); - sval1 += (sval2 * part) / 100; + sval1 += (sint16)(sval2 * part) / 100; memcpy(*out + (i * resample_to_channels * samplewidth) + (samplewidth * j), &sval1, samplewidth);