comparison src/audio/SDL_wave.c @ 171:02e27b705645

Handle the case where the WAVE magic number was already read in a non-seekable stream. I don't know if the code works with non-seekable streams anyway, but ...
author Sam Lantinga <slouken@libsdl.org>
date Tue, 11 Sep 2001 18:52:45 +0000
parents 74212992fb08
children e8157fcb3114
comparison
equal deleted inserted replaced
170:9427fb48592a 171:02e27b705645
432 } 432 }
433 433
434 /* Check the magic header */ 434 /* Check the magic header */
435 RIFFchunk = SDL_ReadLE32(src); 435 RIFFchunk = SDL_ReadLE32(src);
436 wavelen = SDL_ReadLE32(src); 436 wavelen = SDL_ReadLE32(src);
437 WAVEmagic = SDL_ReadLE32(src); 437 if ( wavelen == WAVE ) { /* The RIFFchunk has already been read */
438 WAVEmagic = wavelen;
439 wavelen = RIFFchunk;
440 RIFFchunk = RIFF;
441 } else {
442 WAVEmagic = SDL_ReadLE32(src);
443 }
438 if ( (RIFFchunk != RIFF) || (WAVEmagic != WAVE) ) { 444 if ( (RIFFchunk != RIFF) || (WAVEmagic != WAVE) ) {
439 SDL_SetError("Unrecognized file type (not WAVE)"); 445 SDL_SetError("Unrecognized file type (not WAVE)");
440 was_error = 1; 446 was_error = 1;
441 goto done; 447 goto done;
442 } 448 }