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

Alexandre Julliard julliard at wine.codeweavers.com
Mon Apr 23 08:39:15 CDT 2007


Module: wine
Branch: master
Commit: 364e65a87260c8963b150a04b11af7d5aff0d912
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=364e65a87260c8963b150a04b11af7d5aff0d912

Author: Maarten Lankhorst <m.b.lankhorst at gmail.com>
Date:   Sat Apr 21 20:37:26 2007 +0200

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

---

 dlls/dsound/capture.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/dlls/dsound/capture.c b/dlls/dsound/capture.c
index 1e14acd..240138f 100644
--- a/dlls/dsound/capture.c
+++ b/dlls/dsound/capture.c
@@ -895,7 +895,6 @@ IDirectSoundCaptureBufferImpl_GetCurrentPosition(
 	if (hres != DS_OK)
 	    WARN("IDsCaptureDriverBuffer_GetPosition failed\n");
     } else if (This->device->hwi) {
-	EnterCriticalSection(&(This->device->lock));
 	TRACE("old This->device->state=%s\n",captureStateString[This->device->state]);
         if (lpdwCapturePosition) {
             MMTIME mtime;
@@ -907,6 +906,7 @@ IDirectSoundCaptureBufferImpl_GetCurrentPosition(
             *lpdwCapturePosition = mtime.u.cb;
         }
 
+	EnterCriticalSection(&(This->device->lock));
 	if (lpdwReadPosition) {
             if (This->device->state == STATE_STARTING) {
 		if (lpdwCapturePosition)




More information about the wine-cvs mailing list