summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/enc_config.c2
-rw-r--r--apps/playback.c32
-rw-r--r--apps/settings_list.c10
3 files changed, 42 insertions, 2 deletions
diff --git a/apps/enc_config.c b/apps/enc_config.c
index a971343cab..66aaac22e6 100644
--- a/apps/enc_config.c
+++ b/apps/enc_config.c
@@ -375,7 +375,7 @@ bool enc_get_caps(const struct encoder_config *cfg,
375 else 375 else
376 { 376 {
377 /* If no function provided...defaults to all */ 377 /* If no function provided...defaults to all */
378 caps->samplerate_caps = SAMPR_CAP_ALL; 378 caps->samplerate_caps = SAMPR_CAP_ALL_192;
379 caps->channel_caps = CHN_CAP_ALL; 379 caps->channel_caps = CHN_CAP_ALL;
380 } 380 }
381 381
diff --git a/apps/playback.c b/apps/playback.c
index 504b3f4825..922837af18 100644
--- a/apps/playback.c
+++ b/apps/playback.c
@@ -3820,7 +3820,29 @@ void audio_set_crossfade(int enable)
3820#ifdef HAVE_PLAY_FREQ 3820#ifdef HAVE_PLAY_FREQ
3821static unsigned long audio_guess_frequency(struct mp3entry *id3) 3821static unsigned long audio_guess_frequency(struct mp3entry *id3)
3822{ 3822{
3823 return (id3->frequency % 4000) ? SAMPR_44 : SAMPR_48; 3823 switch (id3->frequency)
3824 {
3825#if HAVE_PLAY_FREQ >= 48
3826 case 44100:
3827 return SAMPR_44;
3828 case 48000:
3829 return SAMPR_48;
3830#endif
3831#if HAVE_PLAY_FREQ >= 96
3832 case 88200:
3833 return SAMPR_88;
3834 case 96000:
3835 return SAMPR_96;
3836#endif
3837#if HAVE_PLAY_FREQ >= 192
3838 case 176400:
3839 return SAMPR_176;
3840 case 192000:
3841 return SAMPR_192;
3842#endif
3843 default:
3844 return (id3->frequency % 4000) ? SAMPR_44 : SAMPR_48;
3845 }
3824} 3846}
3825 3847
3826static void audio_change_frequency_callback(unsigned short id, void *data) 3848static void audio_change_frequency_callback(unsigned short id, void *data)
@@ -3858,7 +3880,15 @@ static void audio_change_frequency_callback(unsigned short id, void *data)
3858 3880
3859void audio_set_playback_frequency(int setting) 3881void audio_set_playback_frequency(int setting)
3860{ 3882{
3883#if HAVE_PLAY_FREQ >= 192
3884 static const unsigned long play_sampr[] = { SAMPR_44, SAMPR_48, SAMPR_88, SAMPR_96, SAMPR_176, SAMPR_192 };
3885#elif HAVE_PLAY_FREQ >= 96
3886 static const unsigned long play_sampr[] = { SAMPR_44, SAMPR_48, SAMPR_88, SAMPR_96 };
3887#elif HAVE_PLAY_FREQ >= 48
3861 static const unsigned long play_sampr[] = { SAMPR_44, SAMPR_48 }; 3888 static const unsigned long play_sampr[] = { SAMPR_44, SAMPR_48 };
3889#else
3890 #error "HAVE_PLAY_FREQ < 48 ??"
3891#endif
3862 3892
3863 if ((unsigned)setting > ARRAYLEN(play_sampr)) /* [0] is "automatic" */ 3893 if ((unsigned)setting > ARRAYLEN(play_sampr)) /* [0] is "automatic" */
3864 setting = 0; 3894 setting = 0;
diff --git a/apps/settings_list.c b/apps/settings_list.c
index 64a150c806..41c20c7809 100644
--- a/apps/settings_list.c
+++ b/apps/settings_list.c
@@ -879,8 +879,18 @@ const struct settings_list settings[] = {
879 ), /* CHOICE_SETTING( repeat_mode ) */ 879 ), /* CHOICE_SETTING( repeat_mode ) */
880#ifdef HAVE_PLAY_FREQ 880#ifdef HAVE_PLAY_FREQ
881 STRINGCHOICE_SETTING(0, play_frequency, LANG_FREQUENCY, 0, 881 STRINGCHOICE_SETTING(0, play_frequency, LANG_FREQUENCY, 0,
882#if HAVE_PLAY_FREQ >= 192
883 "playback frequency", "auto,44.1 kHz,48 kHz,88.2 kHz,96 kHz,176.4 kHz,192 kHz", NULL, 7,
884 LANG_AUTOMATIC, TALK_ID_DECIMAL(441, 1, UNIT_KHZ), TALK_ID(48, UNIT_KHZ), TALK_ID_DECIMAL(882, 1, UNIT_KHZ), TALK_ID(96, UNIT_KHZ), TALK_ID_DECIMAL(1764, 1, UNIT_KHZ), TALK_ID(192, UNIT_KHZ)),
885#elif HAVE_PLAY_FREQ >= 96
886 "playback frequency", "auto,44.1 kHz,48 kHz,88.2 kHz,96 kHz", NULL, 5,
887 LANG_AUTOMATIC, TALK_ID_DECIMAL(441, 1, UNIT_KHZ), TALK_ID(48, UNIT_KHZ), TALK_ID_DECIMAL(882, 1, UNIT_KHZ), TALK_ID(96, UNIT_KHZ)),
888#elif HAVE_PLAY_FREQ >= 48
882 "playback frequency", "auto,44.1 kHz,48 kHz", NULL, 3, 889 "playback frequency", "auto,44.1 kHz,48 kHz", NULL, 3,
883 LANG_AUTOMATIC, TALK_ID_DECIMAL(441, 1, UNIT_KHZ), TALK_ID(48, UNIT_KHZ)), 890 LANG_AUTOMATIC, TALK_ID_DECIMAL(441, 1, UNIT_KHZ), TALK_ID(48, UNIT_KHZ)),
891#else
892 #error "HAVE_PLAY_FREQ < 48???"
893#endif
884#endif /* HAVE_PLAY_FREQ */ 894#endif /* HAVE_PLAY_FREQ */
885 /* LCD */ 895 /* LCD */
886#ifdef HAVE_LCD_CONTRAST 896#ifdef HAVE_LCD_CONTRAST