Commit c3a90ccb authored by Alexander Alekhin's avatar Alexander Alekhin

videoio(MSMF): remove "always true" check

parent 6c196d30
...@@ -1056,18 +1056,15 @@ HRESULT SourceReaderCB::Wait(DWORD dwMilliseconds, _ComPtr<IMFSample>& videoSamp ...@@ -1056,18 +1056,15 @@ HRESULT SourceReaderCB::Wait(DWORD dwMilliseconds, _ComPtr<IMFSample>& videoSamp
return HRESULT_FROM_WIN32(GetLastError()); return HRESULT_FROM_WIN32(GetLastError());
} }
if (!bEOS)
{
cv::AutoLock lock(m_mutex);
bEOS = m_bEOS; bEOS = m_bEOS;
if (!bEOS) if (!bEOS)
{ {
cv::AutoLock lock(m_mutex);
videoSample = m_lastSample; videoSample = m_lastSample;
CV_Assert(videoSample); CV_Assert(videoSample);
m_lastSample.Release(); m_lastSample.Release();
ResetEvent(m_hEvent); // event is auto-reset, but we need this forced reset due time gap between wait() and mutex hold. ResetEvent(m_hEvent); // event is auto-reset, but we need this forced reset due time gap between wait() and mutex hold.
} }
}
return m_hrStatus; return m_hrStatus;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment