summaryrefslogtreecommitdiffstats
path: root/apps/playback.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/playback.c
parent75d2e1f35c0ec40f839687ed2d1a670b0da41a36 (diff)
downloadrockbox-abef23608152a2839c34dcfc283d1561b3eadd45.tar.gz
rockbox-abef23608152a2839c34dcfc283d1561b3eadd45.tar.bz2
rockbox-abef23608152a2839c34dcfc283d1561b3eadd45.zip
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/playback.c')
-rw-r--r--apps/playback.c34
1 files changed, 31 insertions, 3 deletions
diff --git a/apps/playback.c b/apps/playback.c
index 54410ad2cc..28e520319d 100644
--- a/apps/playback.c
+++ b/apps/playback.c
@@ -52,6 +52,10 @@
#endif
#endif
+#ifdef HAVE_PLAY_FREQ
+#include "pcm_mixer.h"
+#endif
+
/* TODO: The audio thread really is doing multitasking of acting like a
consumer and producer of tracks. It may be advantageous to better
logically separate the two functions. I won't go that far just yet. */
@@ -2523,6 +2527,7 @@ static void audio_start_playback(const struct audio_resume_info *resume_info,
resume.elapsed = id3_get(PLAYING_ID3)->elapsed;
resume.offset = id3_get(PLAYING_ID3)->offset;
track_list_clear(TRACK_LIST_CLEAR_ALL);
+ pcmbuf_update_frequency();
}
else
{
@@ -2556,9 +2561,6 @@ static void audio_start_playback(const struct audio_resume_info *resume_info,
#ifndef PLATFORM_HAS_VOLUME_CHANGE
sound_set_volume(global_settings.volume);
#endif
-#ifdef HAVE_PLAY_FREQ
- settings_apply_play_freq(global_settings.play_frequency, true);
-#endif
pcmbuf_update_frequency();
/* Be sure channel is audible */
@@ -3628,6 +3630,12 @@ void playback_release_aa_slot(int slot)
aa_slot->used--;
}
}
+
+void playback_update_aa_dims(void)
+{
+ LOGFQUEUE("audio >| audio Q_AUDIO_REMAKE_AUDIO_BUFFER");
+ audio_queue_send(Q_AUDIO_REMAKE_AUDIO_BUFFER, 0);
+}
#endif /* HAVE_ALBUMART */
/* Return file byte offset */
@@ -3702,6 +3710,26 @@ void audio_set_crossfade(int enable)
}
#endif /* HAVE_CROSSFADE */
+#ifdef HAVE_PLAY_FREQ
+void audio_set_playback_frequency(int setting)
+{
+ static const unsigned long play_sampr[] = { SAMPR_44, SAMPR_48 };
+
+ if ((unsigned)setting >= ARRAYLEN(play_sampr))
+ setting = 0;
+
+ unsigned long playback_sampr = mixer_get_frequency();
+ unsigned long sampr = play_sampr[setting];
+
+ if (sampr != playback_sampr)
+ {
+ mixer_set_frequency(sampr);
+ LOGFQUEUE("audio >| audio Q_AUDIO_REMAKE_AUDIO_BUFFER");
+ audio_queue_send(Q_AUDIO_REMAKE_AUDIO_BUFFER, 0);
+ }
+}
+#endif /* HAVE_PLAY_FREQ */
+
unsigned int playback_status(void)
{
return play_status;