1
0
Fork 0
forked from len0rd/rockbox

Playback speed commit broke mono resampling, this fixes it again.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8111 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Thom Johansen 2005-11-30 01:21:24 +00:00
parent 2f363fe0d6
commit e8b874b039

View file

@ -305,7 +305,7 @@ static long downsample(long **dst, long **src, int count,
long *d[2] = { dst[0], dst[1] };
int pos = phase >> 16;
int i = 1, j;
int num_channels = src[0] == src[1] ? 1 : 2;
int num_channels = dsp->stereo_mode == STEREO_MONO ? 1 : 2;
for (j = 0; j < num_channels; j++) {
last_sample = r->last_sample[j];
@ -343,7 +343,7 @@ static long upsample(long **dst, long **src, int count, struct resample_data *r)
long *d[2] = { dst[0], dst[1] };
int i = 0, j;
int pos;
int num_channels = src[0] == src[1] ? 1 : 2;
int num_channels = dsp->stereo_mode == STEREO_MONO ? 1 : 2;
while ((pos = phase >> 16) == 0)
{
@ -395,7 +395,10 @@ static inline int resample(long* src[], int count)
}
src[0] = dst[0];
src[1] = dst[1];
if (dsp->stereo_mode != STEREO_MONO)
src[1] = dst[1];
else
src[1] = dst[0];
}
else
{