summaryrefslogtreecommitdiffstats
path: root/apps/codec_thread.c
diff options
context:
space:
mode:
authorJeffrey Goode <jeffg7@gmail.com>2009-11-05 21:59:36 +0000
committerJeffrey Goode <jeffg7@gmail.com>2009-11-05 21:59:36 +0000
commit04b01e1831f6d3dcacc7ecddf1b6b8d9e004f2cc (patch)
treeb54e6dc617df5eaa24294d9247dffbd61445d50b /apps/codec_thread.c
parent013fe35992c2e735f6f93e51ca26fb6d61dd8c33 (diff)
downloadrockbox-04b01e1831f6d3dcacc7ecddf1b6b8d9e004f2cc.tar.gz
rockbox-04b01e1831f6d3dcacc7ecddf1b6b8d9e004f2cc.tar.bz2
rockbox-04b01e1831f6d3dcacc7ecddf1b6b8d9e004f2cc.zip
pcmbuf: clarify and simplify crossfade code, etc.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23538 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codec_thread.c')
-rw-r--r--apps/codec_thread.c44
1 files changed, 2 insertions, 42 deletions
diff --git a/apps/codec_thread.c b/apps/codec_thread.c
index fbcb23179d..e3f190e69c 100644
--- a/apps/codec_thread.c
+++ b/apps/codec_thread.c
@@ -416,47 +416,7 @@ void codec_init_codec_api(void)
}
-/** track change functions */
-
-static inline void codec_crossfade_track_change(void)
-{
- /* Initiate automatic crossfade mode */
- pcmbuf_crossfade_init(false);
- /* Notify the wps that the track change starts now */
- LOGFQUEUE("codec > audio Q_AUDIO_TRACK_CHANGED");
- queue_post(&audio_queue, Q_AUDIO_TRACK_CHANGED, 0);
-}
-
-static void codec_track_skip_done(bool was_manual)
-{
- /* Manual track change (always crossfade or flush audio). */
- if (was_manual)
- {
- pcmbuf_crossfade_init(true);
- LOGFQUEUE("codec > audio Q_AUDIO_TRACK_CHANGED");
- queue_post(&audio_queue, Q_AUDIO_TRACK_CHANGED, 0);
- }
- /* Automatic track change w/crossfade, if not in "Track Skip Only" mode. */
- else if (pcmbuf_is_crossfade_enabled() && !pcmbuf_is_crossfade_active()
- && global_settings.crossfade != CROSSFADE_ENABLE_TRACKSKIP)
- {
- if (global_settings.crossfade == CROSSFADE_ENABLE_SHUFFLE_AND_TRACKSKIP)
- {
- if (global_settings.playlist_shuffle)
- /* shuffle mode is on, so crossfade: */
- codec_crossfade_track_change();
- else
- /* shuffle mode is off, so normal gapless playback */
- pcmbuf_start_track_change();
- }
- else
- /* normal crossfade: */
- codec_crossfade_track_change();
- }
- else
- /* normal gapless playback. */
- pcmbuf_start_track_change();
-}
+/* track change */
static bool codec_load_next_track(void)
{
@@ -487,7 +447,7 @@ static bool codec_load_next_track(void)
{
case Q_CODEC_REQUEST_COMPLETE:
LOGFQUEUE("codec |< Q_CODEC_REQUEST_COMPLETE");
- codec_track_skip_done(!automatic_skip);
+ pcmbuf_start_track_change(!automatic_skip);
return true;
case Q_CODEC_REQUEST_FAILED: