From da0650a20999c75935b44480cf555697d6d50177 Mon Sep 17 00:00:00 2001 From: Aric Stewart Date: Mon, 23 Jan 2012 08:33:22 -0600 Subject: [PATCH] quartz: Use the csReceive critical sections in transform filters. --- dlls/quartz/acmwrapper.c | 14 +++++++------- dlls/quartz/avidec.c | 9 ++++----- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/dlls/quartz/acmwrapper.c b/dlls/quartz/acmwrapper.c index 814bf84d314..1c840b70edb 100644 --- a/dlls/quartz/acmwrapper.c +++ b/dlls/quartz/acmwrapper.c @@ -69,12 +69,12 @@ static HRESULT WINAPI ACMWrapper_Receive(TransformFilter *tf, IMediaSample *pSam LONGLONG tStart = -1, tStop = -1, tMed; LONGLONG mtStart = -1, mtStop = -1, mtMed; - EnterCriticalSection(&This->tf.filter.csFilter); + EnterCriticalSection(&This->tf.csReceive); hr = IMediaSample_GetPointer(pSample, &pbSrcStream); if (FAILED(hr)) { ERR("Cannot get pointer to sample data (%x)\n", hr); - LeaveCriticalSection(&This->tf.filter.csFilter); + LeaveCriticalSection(&This->tf.csReceive); return hr; } @@ -105,7 +105,7 @@ static HRESULT WINAPI ACMWrapper_Receive(TransformFilter *tf, IMediaSample *pSam if (FAILED(hr)) { ERR("Unable to retrieve media type\n"); - LeaveCriticalSection(&This->tf.filter.csFilter); + LeaveCriticalSection(&This->tf.csReceive); return hr; } @@ -118,7 +118,7 @@ static HRESULT WINAPI ACMWrapper_Receive(TransformFilter *tf, IMediaSample *pSam if (FAILED(hr)) { ERR("Unable to get delivery buffer (%x)\n", hr); - LeaveCriticalSection(&This->tf.filter.csFilter); + LeaveCriticalSection(&This->tf.csReceive); return hr; } IMediaSample_SetPreroll(pOutSample, preroll); @@ -213,9 +213,9 @@ static HRESULT WINAPI ACMWrapper_Receive(TransformFilter *tf, IMediaSample *pSam TRACE("Sample stop time: %u.%03u\n", (DWORD)(tStart/10000000), (DWORD)((tStart/10000)%1000)); - LeaveCriticalSection(&This->tf.filter.csFilter); + LeaveCriticalSection(&This->tf.csReceive); hr = BaseOutputPinImpl_Deliver((BaseOutputPin*)This->tf.ppPins[1], pOutSample); - EnterCriticalSection(&This->tf.filter.csFilter); + EnterCriticalSection(&This->tf.csReceive); if (hr != S_OK && hr != VFW_E_NOT_CONNECTED) { if (FAILED(hr)) @@ -238,7 +238,7 @@ error: This->lasttime_real = tStop; This->lasttime_sent = tMed; - LeaveCriticalSection(&This->tf.filter.csFilter); + LeaveCriticalSection(&This->tf.csReceive); return hr; } diff --git a/dlls/quartz/avidec.c b/dlls/quartz/avidec.c index e7e1de72204..011e5ffb865 100644 --- a/dlls/quartz/avidec.c +++ b/dlls/quartz/avidec.c @@ -114,7 +114,7 @@ static HRESULT WINAPI AVIDec_Receive(TransformFilter *tf, IMediaSample *pSample) LONGLONG tStart, tStop; DWORD flags = 0; - EnterCriticalSection(&This->tf.filter.csFilter); + EnterCriticalSection(&This->tf.csReceive); hr = IMediaSample_GetPointer(pSample, &pbSrcStream); if (FAILED(hr)) { @@ -192,18 +192,17 @@ static HRESULT WINAPI AVIDec_Receive(TransformFilter *tf, IMediaSample *pSample) else IMediaSample_SetMediaTime(pOutSample, NULL, NULL); - LeaveCriticalSection(&This->tf.filter.csFilter); + LeaveCriticalSection(&This->tf.csReceive); hr = BaseOutputPinImpl_Deliver((BaseOutputPin*)This->tf.ppPins[1], pOutSample); + EnterCriticalSection(&This->tf.csReceive); if (hr != S_OK && hr != VFW_E_NOT_CONNECTED) ERR("Error sending sample (%x)\n", hr); - IMediaSample_Release(pOutSample); - return hr; error: if (pOutSample) IMediaSample_Release(pOutSample); - LeaveCriticalSection(&This->tf.filter.csFilter); + LeaveCriticalSection(&This->tf.csReceive); return hr; } -- 2.11.4.GIT