Aric Stewart : strmbase: do not lock in BaseOutputPinImpl_GetDeliveryBuffer the MemInputPin will lock in the required places .

Alexandre Julliard julliard at winehq.org
Mon May 14 14:26:03 CDT 2012


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

Author: Aric Stewart <aric at codeweavers.com>
Date:   Fri May 11 13:19:38 2012 -0500

strmbase: do not lock in BaseOutputPinImpl_GetDeliveryBuffer the MemInputPin will lock in the required places.

---

 dlls/strmbase/pin.c |   26 +++++++++++---------------
 1 files changed, 11 insertions(+), 15 deletions(-)

diff --git a/dlls/strmbase/pin.c b/dlls/strmbase/pin.c
index 50a90c4..936ae0c 100644
--- a/dlls/strmbase/pin.c
+++ b/dlls/strmbase/pin.c
@@ -580,27 +580,23 @@ HRESULT WINAPI BaseOutputPinImpl_GetDeliveryBuffer(BaseOutputPin *This, IMediaSa
 
     TRACE("(%p, %p, %p, %x)\n", ppSample, tStart, tStop, dwFlags);
 
-    EnterCriticalSection(This->pin.pCritSec);
+    if (!This->pin.pConnectedTo)
+        hr = VFW_E_NOT_CONNECTED;
+    else
     {
-        if (!This->pin.pConnectedTo)
-            hr = VFW_E_NOT_CONNECTED;
-        else
-        {
-            IMemAllocator * pAlloc = NULL;
+        IMemAllocator * pAlloc = NULL;
 
-            hr = IMemInputPin_GetAllocator(This->pMemInputPin, &pAlloc);
+        hr = IMemInputPin_GetAllocator(This->pMemInputPin, &pAlloc);
 
-            if (SUCCEEDED(hr))
-                hr = IMemAllocator_GetBuffer(pAlloc, ppSample, tStart, tStop, dwFlags);
+        if (SUCCEEDED(hr))
+            hr = IMemAllocator_GetBuffer(pAlloc, ppSample, tStart, tStop, dwFlags);
 
-            if (SUCCEEDED(hr))
-                hr = IMediaSample_SetTime(*ppSample, tStart, tStop);
+        if (SUCCEEDED(hr))
+            hr = IMediaSample_SetTime(*ppSample, tStart, tStop);
 
-            if (pAlloc)
-                IMemAllocator_Release(pAlloc);
-        }
+        if (pAlloc)
+            IMemAllocator_Release(pAlloc);
     }
-    LeaveCriticalSection(This->pin.pCritSec);
 
     return hr;
 }




More information about the wine-cvs mailing list