playback: prevent crossfade of new track after pause (FS#13958)

rockbox-gerrit-noreply--- via rockbox-cvs <[email protected]> Sat, 18 Jul 2026 14:08:28 -0400
Newsgroups gmane.comp.systems.archos.rockbox.cvs
Message-ID <[email protected]>
commit 943b73851e9f5cda502ba68121f6e1cfb5d80fc3
Author: Aidan MacDonald <[email protected]>
Date:   Wed Jul 15 22:26:42 2026 +0100

    playback: prevent crossfade of new track after pause (FS#13958)
    
    Wipe the PCM buffer when starting playback from a paused state.
    This prevents unwanted crossfade when manually pausing and then
    selecting a new track.
    
    Change-Id: I55e21004c12a2cd67417b627d471e3da115b7077

diff --git a/apps/playback.c b/apps/playback.c
index 719802e030..6e4e7b2dc3 100644
--- a/apps/playback.c
+++ b/apps/playback.c
@@ -3033,12 +3033,18 @@ static void audio_start_playback(const struct audio_resume_info *resume_info,
         track_event_flags = TEF_NONE;
         ff_rw_mode = false;
 
+        /*
+         * When restarting playback or resuming from a paused state,
+         * the PCM buffer should be cleared to ensure crossfade will
+         * not be performed.
+         */
+        if ((flags & AUDIO_START_RESTART) || old_status == PLAY_PAUSED)
+            pcmbuf_play_stop();
+
         if (flags & AUDIO_START_RESTART)
         {
             /* Clear out some stuff to resume the current track where it
                left off */
-            pcmbuf_play_stop();
-
             resume.elapsed = id3_get(PLAYING_ID3)->elapsed;
             resume.offset = id3_get(PLAYING_ID3)->offset;
             skip_resume_adjustments = id3_get(PLAYING_ID3)->skip_resume_adjustments;
-- 
rockbox-cvs mailing list
[email protected]
https://lists.haxx.se/mailman/listinfo/rockbox-cvs