aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2011-07-21 17:04:33 -0700
committerChris Robinson <[email protected]>2011-07-21 17:04:33 -0700
commit3d2812bd3588dec06ea4544373d870db51b2ec8f (patch)
tree6449a822fb1d6ce51fa9a68e4fc8c349d2f03cce
parenta0e5cbc47fa95b57398af7b0454e2809bba1874b (diff)
Reset the MMDevAPI and DSound events before starting playback
-rw-r--r--Alc/dsound.c3
-rw-r--r--Alc/mmdevapi.c2
2 files changed, 2 insertions, 3 deletions
diff --git a/Alc/dsound.c b/Alc/dsound.c
index 8d2834c2..b1312373 100644
--- a/Alc/dsound.c
+++ b/Alc/dsound.c
@@ -513,6 +513,7 @@ static ALCboolean DSoundResetPlayback(ALCdevice *device)
if(SUCCEEDED(hr))
{
+ ResetEvent(pData->hNotifyEvent);
SetDefaultWFXChannelOrder(device);
pData->thread = StartThread(DSoundProc, device);
if(pData->thread == NULL)
@@ -556,8 +557,6 @@ static void DSoundStopPlayback(ALCdevice *device)
if(pData->DSpbuffer != NULL)
IDirectSoundBuffer_Release(pData->DSpbuffer);
pData->DSpbuffer = NULL;
-
- ResetEvent(pData->hNotifyEvent);
}
diff --git a/Alc/mmdevapi.c b/Alc/mmdevapi.c
index d4840de6..b0c0b289 100644
--- a/Alc/mmdevapi.c
+++ b/Alc/mmdevapi.c
@@ -530,6 +530,7 @@ static ALCboolean MMDevApiResetPlayback(ALCdevice *device)
ERR("Audio client returned buffer_len < period*2; expect break up\n");
}
+ ResetEvent(data->hNotifyEvent);
hr = IAudioClient_SetEventHandle(data->client, data->hNotifyEvent);
if(SUCCEEDED(hr))
hr = IAudioClient_Start(data->client);
@@ -564,7 +565,6 @@ static void MMDevApiStopPlayback(ALCdevice *device)
data->killNow = 0;
IAudioClient_Stop(data->client);
- ResetEvent(data->hNotifyEvent);
}