Skip to content

Commit

Permalink
From Pete Shinners:
Browse files Browse the repository at this point in the history
 I've attached a small patch that cleans up the error reporting when an
 unknown file type is passed to Mix_LoadWAV_RW. this patch adds some minimal
 testing before branching off to the VOC loader, and unknown files now error
 with "Unrecognized sound file type" instead of "Unrecognized file type (not
 VOC)".
  • Loading branch information
icculus committed Oct 16, 2002
1 parent 9316232 commit 776fea7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion mixer.c
Expand Up @@ -40,6 +40,7 @@
#define WAVE 0x45564157 /* "WAVE" */
#define FORM 0x4d524f46 /* "FORM" */
#define OGGS 0x5367674f /* "OggS" */
#define CREA 0x61657243 /* "Crea" */

static int audio_opened = 0;
static SDL_AudioSpec mixer;
Expand Down Expand Up @@ -437,10 +438,13 @@ Mix_Chunk *Mix_LoadWAV_RW(SDL_RWops *src, int freesrc)
(Uint8 **)&chunk->abuf, &chunk->alen);
break;
#endif
default:
case CREA:
loaded = Mix_LoadVOC_RW(src, freesrc, &wavespec,
(Uint8 **)&chunk->abuf, &chunk->alen);
break;
default:
SDL_SetError("Unrecognized sound file type");
return(0);
}
if ( !loaded ) {
free(chunk);
Expand Down

0 comments on commit 776fea7

Please sign in to comment.