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:
parent
d197d40295
commit
50bd40c775
@ -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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/******************************************************************
|
/******************************************************************
|
||||||
|
Loading…
x
Reference in New Issue
Block a user