playwave.c
changeset 83 c95d43cc6d38
parent 70 8ce14b7f7f6f
child 92 2a30d721bd79
     1.1 --- a/playwave.c	Thu Apr 05 21:18:09 2001 +0000
     1.2 +++ b/playwave.c	Thu Apr 05 21:25:56 2001 +0000
     1.3 @@ -84,18 +84,18 @@
     1.4  			audio_format = AUDIO_U8;
     1.5  		} else {
     1.6  			Usage(argv[0]);
     1.7 -			exit(1);
     1.8 +			return(1);
     1.9  		}
    1.10  	}
    1.11  	if ( ! argv[i] ) {
    1.12  		Usage(argv[0]);
    1.13 -		exit(1);
    1.14 +		return(1);
    1.15  	}
    1.16  
    1.17  	/* Initialize the SDL library */
    1.18  	if ( SDL_Init(SDL_INIT_AUDIO) < 0 ) {
    1.19  		fprintf(stderr, "Couldn't initialize SDL: %s\n",SDL_GetError());
    1.20 -		exit(255);
    1.21 +		return(255);
    1.22  	}
    1.23  	atexit(CleanUp);
    1.24  	signal(SIGINT, exit);
    1.25 @@ -104,7 +104,7 @@
    1.26  	/* Open the audio device */
    1.27  	if (Mix_OpenAudio(audio_rate, audio_format, audio_channels, 4096) < 0) {
    1.28  		fprintf(stderr, "Couldn't open audio: %s\n", SDL_GetError());
    1.29 -		exit(2);
    1.30 +		return(2);
    1.31  	} else {
    1.32  		Mix_QuerySpec(&audio_rate, &audio_format, &audio_channels);
    1.33  		printf("Opened audio at %d Hz %d bit %s", audio_rate,
    1.34 @@ -123,7 +123,7 @@
    1.35  	if ( wave == NULL ) {
    1.36  		fprintf(stderr, "Couldn't load %s: %s\n",
    1.37  						argv[i], SDL_GetError());
    1.38 -		exit(2);
    1.39 +		return(2);
    1.40  	}
    1.41  
    1.42  	/* Play and then exit */
    1.43 @@ -131,5 +131,5 @@
    1.44  	while ( Mix_Playing(0) ) {
    1.45  		SDL_Delay(100);
    1.46  	}
    1.47 -	exit(0);
    1.48 +	return(0);
    1.49  }