dsound: Use TIME_KILL_SYNCHRONOUS on sound timer.
This commit is contained in:
parent
0130a18434
commit
1081a9b144
|
@ -1249,10 +1249,8 @@ ULONG DirectSoundDevice_Release(DirectSoundDevice * device)
|
||||||
int i;
|
int i;
|
||||||
timeKillEvent(device->timerID);
|
timeKillEvent(device->timerID);
|
||||||
timeEndPeriod(DS_TIME_RES);
|
timeEndPeriod(DS_TIME_RES);
|
||||||
/* wait for timer to expire */
|
|
||||||
Sleep(DS_TIME_RES+1);
|
|
||||||
|
|
||||||
/* The sleep above should have allowed the timer process to expire
|
/* The kill event should have allowed the timer process to expire
|
||||||
* but try to grab the lock just in case. Can't hold lock because
|
* but try to grab the lock just in case. Can't hold lock because
|
||||||
* IDirectSoundBufferImpl_Destroy also grabs the lock */
|
* IDirectSoundBufferImpl_Destroy also grabs the lock */
|
||||||
RtlAcquireResourceShared(&(device->buffer_list_lock), TRUE);
|
RtlAcquireResourceShared(&(device->buffer_list_lock), TRUE);
|
||||||
|
@ -1521,7 +1519,7 @@ HRESULT DirectSoundDevice_Initialize(DirectSoundDevice ** ppDevice, LPCGUID lpcG
|
||||||
DSOUND_renderer[device->drvdesc.dnDevNode] = device;
|
DSOUND_renderer[device->drvdesc.dnDevNode] = device;
|
||||||
timeBeginPeriod(DS_TIME_RES);
|
timeBeginPeriod(DS_TIME_RES);
|
||||||
DSOUND_renderer[device->drvdesc.dnDevNode]->timerID = timeSetEvent(DS_TIME_DEL, DS_TIME_RES, DSOUND_timer,
|
DSOUND_renderer[device->drvdesc.dnDevNode]->timerID = timeSetEvent(DS_TIME_DEL, DS_TIME_RES, DSOUND_timer,
|
||||||
(DWORD_PTR)DSOUND_renderer[device->drvdesc.dnDevNode], TIME_PERIODIC | TIME_CALLBACK_FUNCTION);
|
(DWORD_PTR)DSOUND_renderer[device->drvdesc.dnDevNode], TIME_PERIODIC | TIME_CALLBACK_FUNCTION | TIME_KILL_SYNCHRONOUS);
|
||||||
} else {
|
} else {
|
||||||
WARN("DSOUND_PrimaryCreate failed\n");
|
WARN("DSOUND_PrimaryCreate failed\n");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue