Don't use crossfader mix mode when skipping tracks manually.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8470 a1c6a512-1295-4272-9138-f99709370657
diff --git a/apps/pcmbuf.c b/apps/pcmbuf.c
index e21f735..f184672 100644
--- a/apps/pcmbuf.c
+++ b/apps/pcmbuf.c
@@ -233,7 +233,7 @@
     return false;
 }
 
-bool pcmbuf_crossfade_init(void)
+bool pcmbuf_crossfade_init(bool manual_skip)
 {
     if (pcmbuf_size - audiobuffer_free < CHUNK_SIZE * 8
         || !pcmbuf_is_crossfade_enabled()
@@ -244,8 +244,12 @@
     logf("pcmbuf_crossfade_init");
     pcmbuf_boost(true);
 
-    crossfade_mode = global_settings.crossfade_fade_out_mixmode
-            ? CFM_MIX : CFM_CROSSFADE;
+    /* Don't enable mix mode when skipping tracks manually. */
+    if (manual_skip)
+        crossfade_mode = CFM_CROSSFADE;
+    else
+        crossfade_mode = global_settings.crossfade_fade_out_mixmode
+                ? CFM_MIX : CFM_CROSSFADE;
     crossfade_init = true;
     
     return true;
diff --git a/apps/pcmbuf.h b/apps/pcmbuf.h
index 7e7ecf1..afc6202 100644
--- a/apps/pcmbuf.h
+++ b/apps/pcmbuf.h
@@ -41,7 +41,7 @@
 bool pcmbuf_is_lowdata(void);
 void pcmbuf_flush_audio(void);
 void pcmbuf_play_start(void);
-bool pcmbuf_crossfade_init(void);
+bool pcmbuf_crossfade_init(bool manual_skip);
 void pcmbuf_add_event(void (*event_handler)(void));
 void pcmbuf_set_position_callback(void (*callback)(int size));
 unsigned int pcmbuf_get_latency(void);
diff --git a/apps/playback.c b/apps/playback.c
index c535e30..3eda695 100644
--- a/apps/playback.c
+++ b/apps/playback.c
@@ -1510,14 +1510,14 @@
     /* Manual track change (always crossfade or flush audio). */
     if (new_track)
     {
-        pcmbuf_crossfade_init();
+        pcmbuf_crossfade_init(true);
         codec_track_changed();
     }
 
     /* Automatic track change with crossfade. */
     else if (pcmbuf_is_crossfade_enabled() && !pcmbuf_is_crossfade_active())
     {
-        pcmbuf_crossfade_init();
+        pcmbuf_crossfade_init(false);
         codec_track_changed();
     }
 
@@ -1574,7 +1574,7 @@
                 stop_codec_flush();
         }
         else if (pcmbuf_is_crossfade_enabled())
-            pcmbuf_crossfade_init();
+            pcmbuf_crossfade_init(new_track != 0);
         
         queue_post(&audio_queue, Q_AUDIO_PLAY, 0);
         return SKIP_OK_DISK;
@@ -1611,7 +1611,7 @@
         /* Stop playback. */
         /* FIXME: Only stop playback if disk is not spinning! */
         if (pcmbuf_is_crossfade_enabled())
-            pcmbuf_crossfade_init();
+            pcmbuf_crossfade_init(true);
         else if (inside_codec_thread)
             pcmbuf_play_stop();
         else
@@ -1747,7 +1747,7 @@
     /* Detect if disk is spinning or already loading. */
     if (filling || ci.reload_codec || !audio_codec_loaded) {
         if (pcmbuf_is_crossfade_enabled())
-            pcmbuf_crossfade_init();
+            pcmbuf_crossfade_init(true);
         else
             pcmbuf_play_stop();
         ci.stop_codec = true;
@@ -2158,7 +2158,7 @@
     {
         ci.stop_codec = true;
         sleep(1);
-        pcmbuf_crossfade_init();
+        pcmbuf_crossfade_init(true);
     }
     else
     {