Commit ba34e91b authored by Sam Lantinga's avatar Sam Lantinga

*** empty log message ***

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401467
parent 2eeceefa
...@@ -4,10 +4,14 @@ ...@@ -4,10 +4,14 @@
/* loopwaves.c is much more robust in handling WAVE files -- /* loopwaves.c is much more robust in handling WAVE files --
This is only for simple WAVEs This is only for simple WAVEs
*/ */
#include "SDL_config.h"
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#if HAVE_SIGNAL_H
#include <signal.h> #include <signal.h>
#endif
#include "SDL.h" #include "SDL.h"
#include "SDL_audio.h" #include "SDL_audio.h"
...@@ -65,12 +69,9 @@ int main(int argc, char *argv[]) ...@@ -65,12 +69,9 @@ int main(int argc, char *argv[])
fprintf(stderr, "Couldn't initialize SDL: %s\n",SDL_GetError()); fprintf(stderr, "Couldn't initialize SDL: %s\n",SDL_GetError());
return(1); return(1);
} }
if ( argv[1] == NULL ) { if ( argv[1] == NULL ) {
fprintf(stderr, "Usage: %s <wavefile>\n", argv[0]); argv[1] = "sample.wav";
quit(1);
} }
/* Load the wave file into memory */ /* Load the wave file into memory */
if ( SDL_LoadWAV(argv[1], if ( SDL_LoadWAV(argv[1],
&wave.spec, &wave.sound, &wave.soundlen) == NULL ) { &wave.spec, &wave.sound, &wave.soundlen) == NULL ) {
...@@ -78,8 +79,9 @@ int main(int argc, char *argv[]) ...@@ -78,8 +79,9 @@ int main(int argc, char *argv[])
argv[1], SDL_GetError()); argv[1], SDL_GetError());
quit(1); quit(1);
} }
wave.spec.callback = fillerup;
wave.spec.callback = fillerup;
#if HAVE_SIGNAL_H
/* Set the signals */ /* Set the signals */
#ifdef SIGHUP #ifdef SIGHUP
signal(SIGHUP, poked); signal(SIGHUP, poked);
...@@ -89,6 +91,7 @@ int main(int argc, char *argv[]) ...@@ -89,6 +91,7 @@ int main(int argc, char *argv[])
signal(SIGQUIT, poked); signal(SIGQUIT, poked);
#endif #endif
signal(SIGTERM, poked); signal(SIGTERM, poked);
#endif /* HAVE_SIGNAL_H */
/* Initialize fillerup() variables */ /* Initialize fillerup() variables */
if ( SDL_OpenAudio(&wave.spec, NULL) < 0 ) { if ( SDL_OpenAudio(&wave.spec, NULL) < 0 ) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment