From beece233c1f3cca88e55750daa4b90fc59b04f05 Mon Sep 17 00:00:00 2001 From: Maarten Lankhorst Date: Tue, 22 Jul 2008 04:09:55 -0700 Subject: [PATCH] quartz: Make transform filter return hresult from functions --- dlls/quartz/transform.c | 27 ++++++++++++++++++--------- 1 files changed, 18 insertions(+), 9 deletions(-) diff --git a/dlls/quartz/transform.c b/dlls/quartz/transform.c index 322c76a..5c090c0 100644 --- a/dlls/quartz/transform.c +++ b/dlls/quartz/transform.c @@ -316,6 +316,7 @@ static HRESULT WINAPI TransformFilter_GetClassID(IBaseFilter * iface, CLSID * pC static HRESULT WINAPI TransformFilter_Stop(IBaseFilter * iface) { TransformFilterImpl *This = (TransformFilterImpl *)iface; + HRESULT hr = S_OK; TRACE("(%p/%p)\n", This, iface); @@ -323,29 +324,33 @@ static HRESULT WINAPI TransformFilter_Stop(IBaseFilter * iface) { This->state = State_Stopped; if (This->pFuncsTable->pfnProcessEnd) - This->pFuncsTable->pfnProcessEnd(This); + hr = This->pFuncsTable->pfnProcessEnd(This); } LeaveCriticalSection(&This->csFilter); - return S_OK; + return hr; } static HRESULT WINAPI TransformFilter_Pause(IBaseFilter * iface) { TransformFilterImpl *This = (TransformFilterImpl *)iface; + HRESULT hr; TRACE("(%p/%p)->()\n", This, iface); EnterCriticalSection(&This->csFilter); { if (This->state == State_Stopped) - IBaseFilter_Run(iface, -1); + hr = IBaseFilter_Run(iface, -1); + else + hr = S_OK; - This->state = State_Paused; + if (SUCCEEDED(hr)) + This->state = State_Paused; } LeaveCriticalSection(&This->csFilter); - return S_OK; + return hr; } static HRESULT WINAPI TransformFilter_Run(IBaseFilter * iface, REFERENCE_TIME tStart) @@ -361,12 +366,16 @@ static HRESULT WINAPI TransformFilter_Run(IBaseFilter * iface, REFERENCE_TIME tS { ((InputPin *)This->ppPins[0])->end_of_stream = 0; if (This->pFuncsTable->pfnProcessBegin) - This->pFuncsTable->pfnProcessBegin(This); - OutputPin_CommitAllocator((OutputPin *)This->ppPins[1]); + hr = This->pFuncsTable->pfnProcessBegin(This); + if (SUCCEEDED(hr)) + hr = OutputPin_CommitAllocator((OutputPin *)This->ppPins[1]); } - This->rtStreamStart = tStart; - This->state = State_Running; + if (SUCCEEDED(hr)) + { + This->rtStreamStart = tStart; + This->state = State_Running; + } } LeaveCriticalSection(&This->csFilter); -- 1.5.4.1