Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
*** empty log message ***
  • Loading branch information
slouken committed Mar 3, 2006
1 parent dba007f commit c88c4b0
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions test/loopwave.c
Expand Up @@ -4,10 +4,14 @@
/* loopwaves.c is much more robust in handling WAVE files --
This is only for simple WAVEs
*/
#include "SDL_config.h"

#include <stdio.h>
#include <stdlib.h>

#if HAVE_SIGNAL_H
#include <signal.h>
#endif

#include "SDL.h"
#include "SDL_audio.h"
Expand Down Expand Up @@ -65,21 +69,19 @@ int main(int argc, char *argv[])
fprintf(stderr, "Couldn't initialize SDL: %s\n",SDL_GetError());
return(1);
}

if ( argv[1] == NULL ) {
fprintf(stderr, "Usage: %s <wavefile>\n", argv[0]);
quit(1);
argv[1] = "sample.wav";
}

/* Load the wave file into memory */
if ( SDL_LoadWAV(argv[1],
&wave.spec, &wave.sound, &wave.soundlen) == NULL ) {
fprintf(stderr, "Couldn't load %s: %s\n",
argv[1], SDL_GetError());
quit(1);
}
wave.spec.callback = fillerup;

wave.spec.callback = fillerup;
#if HAVE_SIGNAL_H
/* Set the signals */
#ifdef SIGHUP
signal(SIGHUP, poked);
Expand All @@ -89,6 +91,7 @@ int main(int argc, char *argv[])
signal(SIGQUIT, poked);
#endif
signal(SIGTERM, poked);
#endif /* HAVE_SIGNAL_H */

/* Initialize fillerup() variables */
if ( SDL_OpenAudio(&wave.spec, NULL) < 0 ) {
Expand Down

0 comments on commit c88c4b0

Please sign in to comment.