1
0
Fork 0
forked from len0rd/rockbox

Correctly read the next track metadata information. Don't crash if

frequency is ever set to 0.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7171 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Miika Pekkarinen 2005-07-16 06:26:29 +00:00
parent 2ef8a8722d
commit cda55bbd6f
3 changed files with 27 additions and 15 deletions

View file

@ -241,9 +241,9 @@ int process(short *dest, long *src, int samplecount)
/* Resample as necessary */
if (dsp_config.frequency > NATIVE_FREQUENCY)
length = upsample(resampled, src, samplecount, &resample[channel]);
else if (dsp_config.frequency < NATIVE_FREQUENCY)
length = downsample(resampled, src, samplecount, &resample[channel]);
else if (dsp_config.frequency < NATIVE_FREQUENCY)
length = upsample(resampled, src, samplecount, &resample[channel]);
else
p = src;
@ -358,6 +358,11 @@ bool dsp_configure(int setting, void *value)
{
switch (setting) {
case DSP_SET_FREQUENCY:
debugf("set frequency: %d\n", (int)value);
if ((int)value == 0) {
dsp_config.frequency = NATIVE_FREQUENCY;
break ;
}
memset(resample, 0, sizeof(resample));
dsp_config.frequency = (int)value;
resample[0].delta = resample[1].delta =