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:
parent
2ef8a8722d
commit
cda55bbd6f
3 changed files with 27 additions and 15 deletions
|
|
@ -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 =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue