Reset the device before closing it - fixes a hang with some audio drivers
authorSam Lantinga <slouken@libsdl.org>
Thu, 06 Dec 2001 01:20:22 +0000
changeset 2488e47ebb7bced
parent 247 b0f09f86378d
child 249 e3d0d44f6f2e
Reset the device before closing it - fixes a hang with some audio drivers
src/audio/dsp/SDL_dspaudio.c
     1.1 --- a/src/audio/dsp/SDL_dspaudio.c	Wed Dec 05 23:49:09 2001 +0000
     1.2 +++ b/src/audio/dsp/SDL_dspaudio.c	Thu Dec 06 01:20:22 2001 +0000
     1.3 @@ -233,6 +233,8 @@
     1.4  		mixbuf = NULL;
     1.5  	}
     1.6  	if ( audio_fd >= 0 ) {
     1.7 +		int value;
     1.8 +		ioctl(audio_fd, SNDCTL_DSP_RESET, &value);
     1.9  		close(audio_fd);
    1.10  		audio_fd = -1;
    1.11  	}