Aric Stewart : quartz: Use the csReceive critical sections in transform filters.
Alexandre Julliard
julliard at winehq.org
Mon Jan 23 13:01:13 CST 2012
Module: wine
Branch: master
Commit: da0650a20999c75935b44480cf555697d6d50177
URL: http://source.winehq.org/git/wine.git/?a=commit;h=da0650a20999c75935b44480cf555697d6d50177
Author: Aric Stewart <aric at codeweavers.com>
Date: Mon Jan 23 08:33:22 2012 -0600
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 814bf84..1c840b7 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 e7e1de7..011e5ff 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;
}
More information about the wine-cvs
mailing list