diff options
author | Underground78 <underground78@users.sourceforge.net> | 2014-10-28 00:36:23 +0300 |
---|---|---|
committer | Underground78 <underground78@users.sourceforge.net> | 2014-10-31 01:06:34 +0300 |
commit | 2105de827532b5adaa157df5da0d7975ea92127a (patch) | |
tree | 40318f8133c7d1fbcc6f932192a831962d5ae563 | |
parent | 717b95ee99b26a2a3bfd34e61c2f7520cc7a85f5 (diff) |
EVR-CP and Sync renderers: Remove useless use of interlocked functions.
The critical sections are lock protected so there is no need for interlocked functions which is a good thing being that those functions were badly used and did not protect anything anyway.
Fixes CID 1249711 and CID 1249712.
-rw-r--r-- | src/filters/renderer/VideoRenderers/EVRAllocatorPresenter.cpp | 5 | ||||
-rw-r--r-- | src/filters/renderer/VideoRenderers/SyncRenderer.cpp | 5 |
2 files changed, 6 insertions, 4 deletions
diff --git a/src/filters/renderer/VideoRenderers/EVRAllocatorPresenter.cpp b/src/filters/renderer/VideoRenderers/EVRAllocatorPresenter.cpp index d16c8784b..d094d0b22 100644 --- a/src/filters/renderer/VideoRenderers/EVRAllocatorPresenter.cpp +++ b/src/filters/renderer/VideoRenderers/EVRAllocatorPresenter.cpp @@ -2550,7 +2550,7 @@ HRESULT CEVRAllocatorPresenter::GetFreeSample(IMFSample** ppSample) HRESULT hr = S_OK;
if (m_FreeSamples.GetCount() > 1) { // <= Cannot use first free buffer (can be currently displayed)
- InterlockedIncrement(&m_nUsedBuffer);
+ m_nUsedBuffer++;
*ppSample = m_FreeSamples.RemoveHead().Detach();
} else {
hr = MF_E_SAMPLEALLOCATOR_EMPTY;
@@ -2578,7 +2578,8 @@ HRESULT CEVRAllocatorPresenter::GetScheduledSample(IMFSample** ppSample, int& _C void CEVRAllocatorPresenter::MoveToFreeList(IMFSample* pSample, bool bTail)
{
CAutoLock lock(&m_SampleQueueLock);
- InterlockedDecrement(&m_nUsedBuffer);
+
+ m_nUsedBuffer--;
if (m_bPendingMediaFinished && m_nUsedBuffer == 0) {
m_bPendingMediaFinished = false;
m_pSink->Notify(EC_COMPLETE, 0, 0);
diff --git a/src/filters/renderer/VideoRenderers/SyncRenderer.cpp b/src/filters/renderer/VideoRenderers/SyncRenderer.cpp index f5bd188b4..5c09a296e 100644 --- a/src/filters/renderer/VideoRenderers/SyncRenderer.cpp +++ b/src/filters/renderer/VideoRenderers/SyncRenderer.cpp @@ -3859,7 +3859,7 @@ HRESULT CSyncAP::GetFreeSample(IMFSample** ppSample) HRESULT hr = S_OK;
if (m_FreeSamples.GetCount() > 1) { // Cannot use first free buffer (can be currently displayed)
- InterlockedIncrement(&m_nUsedBuffer);
+ m_nUsedBuffer++;
*ppSample = m_FreeSamples.RemoveHead().Detach();
} else {
hr = MF_E_SAMPLEALLOCATOR_EMPTY;
@@ -3887,7 +3887,8 @@ HRESULT CSyncAP::GetScheduledSample(IMFSample** ppSample, int& _Count) void CSyncAP::MoveToFreeList(IMFSample* pSample, bool bTail)
{
CAutoLock lock(&m_SampleQueueLock);
- InterlockedDecrement(&m_nUsedBuffer);
+
+ m_nUsedBuffer--;
if (m_bPendingMediaFinished && m_nUsedBuffer == 0) {
m_bPendingMediaFinished = false;
m_pSink->Notify(EC_COMPLETE, 0, 0);
|