Skip to content
This repository has been archived by the owner on Feb 3, 2025. It is now read-only.

Commit

Permalink
Cleanly handle "MF_E_SHUTDOWN" error when an even is received while t…
Browse files Browse the repository at this point in the history
…he session is shutting down
  • Loading branch information
Mamadou DIOP committed Nov 10, 2015
1 parent c82f450 commit 7ff6a24
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions plugins/pluginWinMF/plugin_win_mf_producer_video.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -684,10 +684,16 @@ static void* TSK_STDCALL RunSessionThread(void *pArg)
TSK_DEBUG_INFO("RunSessionThread (MF video producer) - ENTER");

while (pSelf->bStarted){
CHECK_HR(hr = pSelf->pSession->GetEvent(0, &pEvent));
hr = pSelf->pSession->GetEvent(0, &pEvent);
if (hr == MF_E_SHUTDOWN) {
if (pSelf->bStarted) {
CHECK_HR(hr); // Shutdown called but "bStarted" not equal to false
}
break; // Shutdown called and "bStarted" is equal to false => break the loop
}
CHECK_HR(hr = pEvent->GetStatus(&hrStatus));
CHECK_HR(hr = pEvent->GetType(&met));

if (FAILED(hrStatus) /*&& hrStatus != MF_E_NO_SAMPLE_TIMESTAMP*/)
{
TSK_DEBUG_ERROR("Session error: 0x%x (event id: %d)\n", hrStatus, met);
Expand Down

0 comments on commit 7ff6a24

Please sign in to comment.