Reset the oss device before we try to close it. Fixes hang on startup

of Starcraft due to oss device being in a bad state.
This commit is contained in:
Chris Morgan 2002-12-10 19:06:51 +00:00 committed by Alexandre Julliard
parent d197d40295
commit 50bd40c775
1 changed files with 6 additions and 1 deletions

View File

@ -369,7 +369,12 @@ static DWORD OSS_OpenDevice(OSS_DEVICE* ossdev, unsigned req_access,
*/
static void OSS_CloseDevice(OSS_DEVICE* ossdev)
{
if (--ossdev->open_count == 0) close(ossdev->fd);
if (--ossdev->open_count == 0)
{
/* reset the device before we close it in case it is in a bad state */
ioctl(ossdev->fd, SNDCTL_DSP_RESET, 0);
close(ossdev->fd);
}
}
/******************************************************************