summaryrefslogtreecommitdiff
path: root/apps/codecs/flac.c
diff options
context:
space:
mode:
authorMiika Pekkarinen <miipekk@ihme.org>2005-06-26 19:41:29 +0000
committerMiika Pekkarinen <miipekk@ihme.org>2005-06-26 19:41:29 +0000
commitd8cb703b1e86c9f910211a976d8bed0c7a99379a (patch)
tree6db3b698d83e639974bd6603225ff11891652113 /apps/codecs/flac.c
parent316eb6538e2fc88efa93248deb761679071409f1 (diff)
downloadrockbox-d8cb703b1e86c9f910211a976d8bed0c7a99379a.zip
rockbox-d8cb703b1e86c9f910211a976d8bed0c7a99379a.tar.gz
rockbox-d8cb703b1e86c9f910211a976d8bed0c7a99379a.tar.bz2
rockbox-d8cb703b1e86c9f910211a976d8bed0c7a99379a.tar.xz
Initial DSP implementation. DSP supports resampling audio stream from
codecs (currently works corrently only with mp3's, somebody should fix that). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6877 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs/flac.c')
-rw-r--r--apps/codecs/flac.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/apps/codecs/flac.c b/apps/codecs/flac.c
index 07e5b8f..d7ae037 100644
--- a/apps/codecs/flac.c
+++ b/apps/codecs/flac.c
@@ -22,6 +22,7 @@
#include <codecs/libFLAC/include/FLAC/seekable_stream_decoder.h>
#include "playback.h"
#include "lib/codeclib.h"
+#include "dsp.h"
#define FLAC_MAX_SUPPORTED_BLOCKSIZE 4608
#define FLAC_MAX_SUPPORTED_CHANNELS 2
@@ -180,12 +181,26 @@ enum codec_status codec_start(struct codec_api* api)
ci->configure(CODEC_SET_FILEBUF_WATERMARK, (int *)(1024*512));
ci->configure(CODEC_SET_FILEBUF_CHUNKSIZE, (int *)(1024*128));
+ ci->configure(DSP_DITHER, (bool *)false);
+ ci->configure(DSP_SET_STEREO_MODE, (int *)STEREO_INTERLEAVED);
+ ci->configure(DSP_SET_SAMPLE_DEPTH, (int *)(16));
+
next_track:
if (codec_init(api)) {
return CODEC_ERROR;
}
+ while (!rb->taginfo_ready)
+ rb->yield();
+
+ if (rb->id3->frequency != NATIVE_FREQUENCY) {
+ rb->configure(DSP_SET_FREQUENCY, (long *)(rb->id3->frequency));
+ rb->configure(CODEC_DSP_ENABLE, (bool *)true);
+ } else {
+ rb->configure(CODEC_DSP_ENABLE, (bool *)false);
+ }
+
/* Create a decoder instance */
flacDecoder=FLAC__seekable_stream_decoder_new();