diff --git a/docs/sdlamp2-fsd.md b/docs/sdlamp2-fsd.md index 51a275c..a9be482 100644 --- a/docs/sdlamp2-fsd.md +++ b/docs/sdlamp2-fsd.md @@ -43,6 +43,10 @@ This document specifies the functional requirements for an SDL2 based media play ## 6. Changelog +### 2026-02-14 — Fix residual audio on cassette switch + +- **Clear device queue on switch**: `switch_file()` now calls `SDL_ClearQueuedAudio()` after pausing the audio device, preventing a brief snippet of the previous cassette from playing when the new one starts. + ### 2026-02-14 — Split-screen layout with artwork focus - **Vertical left panel**: Transport controls (Prev, Rewind, Play/Stop, FF, Next) are stacked vertically in a 200px-wide left panel. Play/Stop is slightly larger (72x72) at the vertical center; other buttons are 56x56. diff --git a/src/sdlamp2.c b/src/sdlamp2.c index cdb0451..9adaa78 100644 --- a/src/sdlamp2.c +++ b/src/sdlamp2.c @@ -522,6 +522,7 @@ static void switch_file(int index) { paused = SDL_TRUE; SDL_PauseAudioDevice(audio_device, 1); + SDL_ClearQueuedAudio(audio_device); return; }