From 1f3abd341ff1e2c38afad2a9d79dc2fe787799a1 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Sun, 21 Sep 2014 17:18:11 +0000 Subject: [PATCH] [STRMBASE] * Sync with Wine 1.7.27. CORE-8540 svn path=/trunk/; revision=64216 --- reactos/lib/3rdparty/strmbase/pin.c | 35 ++++++++++++++++-------- reactos/lib/3rdparty/strmbase/renderer.c | 10 +++---- reactos/media/doc/README.WINE | 2 +- 3 files changed, 29 insertions(+), 18 deletions(-) diff --git a/reactos/lib/3rdparty/strmbase/pin.c b/reactos/lib/3rdparty/strmbase/pin.c index ee0cf7c6beb..5032c76886e 100644 --- a/reactos/lib/3rdparty/strmbase/pin.c +++ b/reactos/lib/3rdparty/strmbase/pin.c @@ -71,7 +71,6 @@ static HRESULT SendFurther( IPin *from, SendPinFunc fnMiddle, LPVOID arg, SendPi hr = IPin_QueryInternalConnections( from, NULL, &amount ); if (hr != E_NOTIMPL && amount) FIXME("Use QueryInternalConnections!\n"); - hr = S_OK; pin_info.pFilter = NULL; hr = IPin_QueryPinInfo( from, &pin_info ); @@ -391,11 +390,7 @@ ULONG WINAPI BaseOutputPinImpl_Release(IPin * iface) if (!refCount) { - FreeMediaType(&This->pin.mtCurrent); - if (This->pAllocator) - IMemAllocator_Release(This->pAllocator); - This->pAllocator = NULL; - CoTaskMemFree(This); + BaseOutputPin_Destroy(This); return 0; } return refCount; @@ -839,6 +834,16 @@ HRESULT WINAPI BaseOutputPin_Construct(const IPinVtbl *OutputPin_Vtbl, LONG outp return E_FAIL; } +HRESULT WINAPI BaseOutputPin_Destroy(BaseOutputPin *This) +{ + FreeMediaType(&This->pin.mtCurrent); + if (This->pAllocator) + IMemAllocator_Release(This->pAllocator); + This->pAllocator = NULL; + CoTaskMemFree(This); + return S_OK; +} + /*** Input Pin implementation ***/ static inline BaseInputPin *impl_BaseInputPin_from_IPin( IPin *iface ) @@ -890,12 +895,7 @@ ULONG WINAPI BaseInputPinImpl_Release(IPin * iface) if (!refCount) { - FreeMediaType(&This->pin.mtCurrent); - if (This->pAllocator) - IMemAllocator_Release(This->pAllocator); - This->pAllocator = NULL; - This->pin.IPin_iface.lpVtbl = NULL; - CoTaskMemFree(This); + BaseInputPin_Destroy(This); return 0; } else @@ -1263,3 +1263,14 @@ HRESULT BaseInputPin_Construct(const IPinVtbl *InputPin_Vtbl, LONG inputpin_size CoTaskMemFree(pPinImpl); return E_FAIL; } + +HRESULT WINAPI BaseInputPin_Destroy(BaseInputPin *This) +{ + FreeMediaType(&This->pin.mtCurrent); + if (This->pAllocator) + IMemAllocator_Release(This->pAllocator); + This->pAllocator = NULL; + This->pin.IPin_iface.lpVtbl = NULL; + CoTaskMemFree(This); + return S_OK; +} diff --git a/reactos/lib/3rdparty/strmbase/renderer.c b/reactos/lib/3rdparty/strmbase/renderer.c index cf2f318244f..21ea48df0d3 100644 --- a/reactos/lib/3rdparty/strmbase/renderer.c +++ b/reactos/lib/3rdparty/strmbase/renderer.c @@ -95,8 +95,8 @@ static HRESULT WINAPI BaseRenderer_InputPin_EndOfStream(IPin * iface) TRACE("(%p/%p)->()\n", This, pFilter); - EnterCriticalSection(&pFilter->filter.csFilter); EnterCriticalSection(&pFilter->csRenderLock); + EnterCriticalSection(&pFilter->filter.csFilter); hr = BaseInputPinImpl_EndOfStream(iface); EnterCriticalSection(This->pin.pCritSec); if (SUCCEEDED(hr)) @@ -107,8 +107,8 @@ static HRESULT WINAPI BaseRenderer_InputPin_EndOfStream(IPin * iface) hr = BaseRendererImpl_EndOfStream(pFilter); } LeaveCriticalSection(This->pin.pCritSec); - LeaveCriticalSection(&pFilter->csRenderLock); LeaveCriticalSection(&pFilter->filter.csFilter); + LeaveCriticalSection(&pFilter->csRenderLock); return hr; } @@ -120,8 +120,8 @@ static HRESULT WINAPI BaseRenderer_InputPin_BeginFlush(IPin * iface) TRACE("(%p/%p)->()\n", This, iface); - EnterCriticalSection(&pFilter->filter.csFilter); EnterCriticalSection(&pFilter->csRenderLock); + EnterCriticalSection(&pFilter->filter.csFilter); EnterCriticalSection(This->pin.pCritSec); hr = BaseInputPinImpl_BeginFlush(iface); if (SUCCEEDED(hr)) @@ -145,8 +145,8 @@ static HRESULT WINAPI BaseRenderer_InputPin_EndFlush(IPin * iface) TRACE("(%p/%p)->()\n", This, pFilter); - EnterCriticalSection(&pFilter->filter.csFilter); EnterCriticalSection(&pFilter->csRenderLock); + EnterCriticalSection(&pFilter->filter.csFilter); EnterCriticalSection(This->pin.pCritSec); hr = BaseInputPinImpl_EndFlush(iface); if (SUCCEEDED(hr)) @@ -157,8 +157,8 @@ static HRESULT WINAPI BaseRenderer_InputPin_EndFlush(IPin * iface) hr = BaseRendererImpl_EndFlush(pFilter); } LeaveCriticalSection(This->pin.pCritSec); - LeaveCriticalSection(&pFilter->csRenderLock); LeaveCriticalSection(&pFilter->filter.csFilter); + LeaveCriticalSection(&pFilter->csRenderLock); return hr; } diff --git a/reactos/media/doc/README.WINE b/reactos/media/doc/README.WINE index 27ae61b8f84..f0bc7b6e3ff 100644 --- a/reactos/media/doc/README.WINE +++ b/reactos/media/doc/README.WINE @@ -248,7 +248,7 @@ In addition the following libs, dlls and source files are mostly based on code p from Winehq CVS. If you are looking to update something in these files check Wine current souces first as it may already be fixed. -reactos/lib/3rdparty/strmbase # Synced to Wine-1.7.17 +reactos/lib/3rdparty/strmbase # Synced to Wine-1.7.27 advapi32 - reactos/dll/win32/advapi32/crypt/*.c # Synced to Wine-1.7.1 -- 2.17.1