summaryrefslogtreecommitdiff
path: root/apps/settings.c
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2017-11-24 07:55:56 -0500
committerMichael Sevakis <jethead71@rockbox.org>2017-11-24 08:55:49 -0500
commitabef23608152a2839c34dcfc283d1561b3eadd45 (patch)
treeeb03da5bfd7bc9ec7858e3fed123b93ece24df90 /apps/settings.c
parent75d2e1f35c0ec40f839687ed2d1a670b0da41a36 (diff)
Do playback restarts the proper way
It isn't necessary to explicitly stop and restart playback to force it to update something that must cause rebuffering. Change-Id: I6ff5394fcafc7374af67ef9fbf9022bb4a79b773
Diffstat (limited to 'apps/settings.c')
-rw-r--r--apps/settings.c44
1 files changed, 3 insertions, 41 deletions
diff --git a/apps/settings.c b/apps/settings.c
index aa51e051e9..8afec9f806 100644
--- a/apps/settings.c
+++ b/apps/settings.c
@@ -87,10 +87,6 @@ struct system_status global_status;
#include "enc_config.h"
#endif
#include "pcm_sampr.h"
-#ifdef HAVE_PLAY_FREQ
-#include "pcm_mixer.h"
-#include "dsp_core.h"
-#endif
#endif /* CONFIG_CODEC == SWCODEC */
#define NVRAM_BLOCK_SIZE 44
@@ -735,41 +731,6 @@ void settings_apply_pm_range(void)
}
#endif /* HAVE_LCD_BITMAP */
-#ifdef HAVE_PLAY_FREQ
-void settings_apply_play_freq(int value, bool playback)
-{
- static const unsigned long play_sampr[] = { SAMPR_44, SAMPR_48 };
- static int prev_setting = 0;
-
- if ((unsigned)value >= ARRAYLEN(play_sampr))
- value = 0;
-
- bool changed = value != prev_setting;
- prev_setting = value;
-
- unsigned long elapsed = 0;
- unsigned long offset = 0;
- bool playing = changed && !playback &&
- audio_status() == AUDIO_STATUS_PLAY;
-
- if (playing)
- {
- struct mp3entry *id3 = audio_current_track();
- elapsed = id3->elapsed;
- offset = id3->offset;
- }
-
- if (changed && !playback)
- audio_hard_stop();
-
- /* Other sub-areas of playback pick it up from the mixer */
- mixer_set_frequency(play_sampr[value]);
-
- if (playing)
- audio_play(elapsed, offset);
-}
-#endif /* HAVE_PLAY_FREQ */
-
void sound_settings_apply(void)
{
#ifdef AUDIOHW_HAVE_BASS
@@ -1023,10 +984,11 @@ void settings_apply(bool read_disk)
lcd_scroll_delay(global_settings.scroll_delay);
+#if CONFIG_CODEC == SWCODEC
#ifdef HAVE_PLAY_FREQ
- settings_apply_play_freq(global_settings.play_frequency, false);
+ /* before crossfade */
+ audio_set_playback_frequency(global_settings.play_frequency);
#endif
-#if CONFIG_CODEC == SWCODEC
#ifdef HAVE_CROSSFADE
audio_set_crossfade(global_settings.crossfade);
#endif