forked from len0rd/rockbox
Initializing resampler structure correctly with zeros.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6900 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
c2093538a4
commit
4613659643
1 changed files with 3 additions and 1 deletions
|
|
@ -16,6 +16,7 @@
|
||||||
* KIND, either express or implied.
|
* KIND, either express or implied.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
#include <string.h>
|
||||||
#include "kernel.h"
|
#include "kernel.h"
|
||||||
#include "logf.h"
|
#include "logf.h"
|
||||||
|
|
||||||
|
|
@ -227,7 +228,7 @@ long upsample(long *out, long *in, int num, struct resampler *s)
|
||||||
}
|
}
|
||||||
|
|
||||||
#define MAX_CHUNK_SIZE 1024
|
#define MAX_CHUNK_SIZE 1024
|
||||||
static char samplebuf[MAX_CHUNK_SIZE*4];
|
static char samplebuf[MAX_CHUNK_SIZE];
|
||||||
/* enough to cope with 11khz upsampling */
|
/* enough to cope with 11khz upsampling */
|
||||||
long resampled[MAX_CHUNK_SIZE * 4];
|
long resampled[MAX_CHUNK_SIZE * 4];
|
||||||
|
|
||||||
|
|
@ -353,6 +354,7 @@ bool dsp_configure(int setting, void *value)
|
||||||
{
|
{
|
||||||
switch (setting) {
|
switch (setting) {
|
||||||
case DSP_SET_FREQUENCY:
|
case DSP_SET_FREQUENCY:
|
||||||
|
memset(resample, 0, sizeof(resample));
|
||||||
dsp_config.frequency = (int)value;
|
dsp_config.frequency = (int)value;
|
||||||
resample[0].delta = resample[1].delta =
|
resample[0].delta = resample[1].delta =
|
||||||
(unsigned long)value*65536/NATIVE_FREQUENCY;
|
(unsigned long)value*65536/NATIVE_FREQUENCY;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue