Fix residual audio from previous cassette on file switch

Clear the SDL audio device queue in switch_file() so leftover
samples from the previous cassette don't play when the new one starts.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Michael Smith 2026-02-14 11:50:46 +01:00
parent 201a8fae97
commit 25824d4728
2 changed files with 5 additions and 0 deletions

View File

@ -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.

View File

@ -522,6 +522,7 @@ static void switch_file(int index) {
paused = SDL_TRUE;
SDL_PauseAudioDevice(audio_device, 1);
SDL_ClearQueuedAudio(audio_device);
return;
}