From e4daf100d2b1a51a19501df8173dde8d39a6e70e Mon Sep 17 00:00:00 2001 From: jethead71 Date: Sat, 26 Jun 2010 10:37:41 +0000 Subject: [PATCH] Should clear up rest of red. Add a required #define in the config for c200. Fix up some preprocessing directives. Hope it's all taken care of now. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27141 a1c6a512-1295-4272-9138-f99709370657 --- firmware/drivers/audio/sdl.c | 7 +++++-- firmware/export/config/sansac200.h | 5 +++++ firmware/export/pcm_sampr.h | 2 +- firmware/pcm.c | 4 +++- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/firmware/drivers/audio/sdl.c b/firmware/drivers/audio/sdl.c index f4c622d7a..7d6d7452d 100644 --- a/firmware/drivers/audio/sdl.c +++ b/firmware/drivers/audio/sdl.c @@ -22,6 +22,7 @@ #include #include "config.h" #include "audiohw.h" +#include "pcm_sampr.h" /** * Audio Hardware api. Make them do nothing as we cannot properly simulate with @@ -162,10 +163,12 @@ void audiohw_set_eq_band_width(unsigned int band, int value) void audiohw_set_depth_3d(int value) { (void)value; } #endif -#if defined(HAVE_SAMPR_TYPE_REC) -unsigned int pcm_sampr_type_rec_to_play(int samplerate) +#ifdef HAVE_RECORDING +#if SAMPR_TYPE_REC != 0 +unsigned int pcm_sampr_type_rec_to_play(unsigned int samplerate) { return samplerate; } #endif +#endif /* HAVE_RECORDING */ #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) int mas_codec_readreg(int reg) { diff --git a/firmware/export/config/sansac200.h b/firmware/export/config/sansac200.h index 6c05ba5a1..3240af43f 100644 --- a/firmware/export/config/sansac200.h +++ b/firmware/export/config/sansac200.h @@ -16,6 +16,11 @@ #define REC_FREQ_DEFAULT REC_FREQ_22 /* Default is not 44.1kHz */ #define REC_SAMPR_DEFAULT SAMPR_22 +/* because the samplerates don't match at each point, we must be able to + * tell PCM which set of rates to use. not needed if recording rates are + * a simple subset of playback rates and are equal values. */ +#define CONFIG_SAMPR_TYPES + /* Define bitmask of input sources - recordable bitmask can be defined explicitly if different */ #define INPUT_SRC_CAPS (SRC_CAP_MIC | SRC_CAP_FMRADIO) diff --git a/firmware/export/pcm_sampr.h b/firmware/export/pcm_sampr.h index c46e3ea9e..62bfd0068 100644 --- a/firmware/export/pcm_sampr.h +++ b/firmware/export/pcm_sampr.h @@ -324,7 +324,7 @@ extern const unsigned long rec_freq_sampr[REC_NUM_FREQ]; #define SAMPR_TYPE_REC (0x01 << 24) #endif -unsigned int sampr_type_rec_to_play(unsigned int samplerate); +unsigned int pcm_sampr_type_rec_to_play(unsigned int samplerate); #else /* ndef CONFIG_SAMPR_TYPES */ diff --git a/firmware/pcm.c b/firmware/pcm.c index 72fe23cb1..76a0ea277 100644 --- a/firmware/pcm.c +++ b/firmware/pcm.c @@ -367,7 +367,8 @@ void pcm_set_frequency(unsigned int samplerate) unsigned int type = samplerate & SAMPR_TYPE_MASK; samplerate &= ~SAMPR_TYPE_MASK; -#ifdef SAMPR_TYPE_REC +#ifdef HAVE_RECORDING +#if SAMPR_TYPE_REC != 0 /* For now, supported targets have direct conversion when configured with * CONFIG_SAMPR_TYPES. * Some hypothetical target with independent rates would need slightly @@ -375,6 +376,7 @@ void pcm_set_frequency(unsigned int samplerate) if (type == SAMPR_TYPE_REC) samplerate = pcm_sampr_type_rec_to_play(samplerate); #endif +#endif /* HAVE_RECORDING */ #endif /* CONFIG_SAMPR_TYPES */ index = round_value_to_list32(samplerate, hw_freq_sampr, -- 2.11.4.GIT