mirror of
https://github.com/Rockbox/rockbox.git
synced 2026-05-12 11:43:16 -04:00
plugins: sdl: fix LoadWAVStream failing to load WAV files
Reading the WAV length seems to have been accidentally
commented out in commit e28d1fe916. The WAV length is
not used here but disabling the read broke WAV header
parsing completely.
Change-Id: Ia6d0b1a168b2b029bd1cbec9bdc482caf6fa0487
This commit is contained in:
parent
80e3c0b065
commit
31d8118581
1 changed files with 6 additions and 2 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue