Commit 364e65a8 authored by Maarten Lankhorst's avatar Maarten Lankhorst Committed by Alexandre Julliard

dsound: Don't deadlock in capture because of callback.

parent 836776ae
...@@ -895,7 +895,6 @@ IDirectSoundCaptureBufferImpl_GetCurrentPosition( ...@@ -895,7 +895,6 @@ IDirectSoundCaptureBufferImpl_GetCurrentPosition(
if (hres != DS_OK) if (hres != DS_OK)
WARN("IDsCaptureDriverBuffer_GetPosition failed\n"); WARN("IDsCaptureDriverBuffer_GetPosition failed\n");
} else if (This->device->hwi) { } else if (This->device->hwi) {
EnterCriticalSection(&(This->device->lock));
TRACE("old This->device->state=%s\n",captureStateString[This->device->state]); TRACE("old This->device->state=%s\n",captureStateString[This->device->state]);
if (lpdwCapturePosition) { if (lpdwCapturePosition) {
MMTIME mtime; MMTIME mtime;
...@@ -907,6 +906,7 @@ IDirectSoundCaptureBufferImpl_GetCurrentPosition( ...@@ -907,6 +906,7 @@ IDirectSoundCaptureBufferImpl_GetCurrentPosition(
*lpdwCapturePosition = mtime.u.cb; *lpdwCapturePosition = mtime.u.cb;
} }
EnterCriticalSection(&(This->device->lock));
if (lpdwReadPosition) { if (lpdwReadPosition) {
if (This->device->state == STATE_STARTING) { if (This->device->state == STATE_STARTING) {
if (lpdwCapturePosition) if (lpdwCapturePosition)
......
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