plugins: sdl: fix LoadWAVStream failing to load WAV files
rockbox-gerrit-noreply--- via rockbox-cvs <[email protected]> Sat, 25 Apr 2026 10:56:14 -0400
| Newsgroups | gmane.comp.systems.archos.rockbox.cvs |
|---|---|
| Message-ID | <[email protected]> |
commit 31d8118581d98cb04752fcd343453019d6a8206d Author: Aidan MacDonald <[email protected]> Date: Sat Apr 25 15:48:07 2026 +0100 plugins: sdl: fix LoadWAVStream failing to load WAV files Reading the WAV length seems to have been accidentally commented out in commit e28d1fe91671. The WAV length is not used here but disabling the read broke WAV header parsing completely. Change-Id: Ia6d0b1a168b2b029bd1cbec9bdc482caf6fa0487 diff --git a/apps/plugins/sdl/SDL_mixer/wavestream.c b/apps/plugins/sdl/SDL_mixer/wavestream.c index 489863908f..8dbb2a934a 100644 --- a/apps/plugins/sdl/SDL_mixer/wavestream.c +++ b/apps/plugins/sdl/SDL_mixer/wavestream.c @@ -286,7 +286,7 @@ static SDL_RWops *LoadWAVStream (SDL_RWops *src, SDL_AudioSpec *spec, /* WAV magic header */ Uint32 RIFFchunk; -// Uint32 wavelen; + Uint32 wavelen; Uint32 WAVEmagic; /* FMT chunk */ @@ -296,8 +296,12 @@ static SDL_RWops *LoadWAVStream (SDL_RWops *src, SDL_AudioSpec *spec, /* Check the magic header */ RIFFchunk = SDL_ReadLE32(src); -// wavelen = SDL_ReadLE32(src); + wavelen = SDL_ReadLE32(src); WAVEmagic = SDL_ReadLE32(src); + + /* Unused */ + (void)wavelen; + if ( (RIFFchunk != RIFF) || (WAVEmagic != WAVE) ) { Mix_SetError("Unrecognized file type (not WAVE)"); was_error = 1; -- rockbox-cvs mailing list [email protected] https://lists.haxx.se/mailman/listinfo/rockbox-cvs