Commit 50bd40c7 authored by Chris Morgan's avatar Chris Morgan Committed by Alexandre Julliard

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.
parent d197d402
...@@ -369,7 +369,12 @@ static DWORD OSS_OpenDevice(OSS_DEVICE* ossdev, unsigned req_access, ...@@ -369,7 +369,12 @@ static DWORD OSS_OpenDevice(OSS_DEVICE* ossdev, unsigned req_access,
*/ */
static void OSS_CloseDevice(OSS_DEVICE* ossdev) 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);
}
} }
/****************************************************************** /******************************************************************
......
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