comparison src/audio/dsp/SDL_dspaudio.c @ 248:8e47ebb7bced

Reset the device before closing it - fixes a hang with some audio drivers
author Sam Lantinga <slouken@libsdl.org>
date Thu, 06 Dec 2001 01:20:22 +0000
parents c7bcdece4845
children e8157fcb3114
comparison
equal deleted inserted replaced
247:b0f09f86378d 248:8e47ebb7bced
231 if ( mixbuf != NULL ) { 231 if ( mixbuf != NULL ) {
232 SDL_FreeAudioMem(mixbuf); 232 SDL_FreeAudioMem(mixbuf);
233 mixbuf = NULL; 233 mixbuf = NULL;
234 } 234 }
235 if ( audio_fd >= 0 ) { 235 if ( audio_fd >= 0 ) {
236 int value;
237 ioctl(audio_fd, SNDCTL_DSP_RESET, &value);
236 close(audio_fd); 238 close(audio_fd);
237 audio_fd = -1; 239 audio_fd = -1;
238 } 240 }
239 } 241 }
240 242