diff options
author | Mamadou DIOP <bossiel@yahoo.fr> | 2015-11-11 00:58:19 +0100 |
---|---|---|
committer | Mamadou DIOP <bossiel@yahoo.fr> | 2015-11-11 00:58:19 +0100 |
commit | 7ff6a247a8ec64673fa7920225b47a8b9224f078 (patch) | |
tree | 7ed8fc9defc691b2254c6325e7c49eecec37205f /plugins | |
parent | c82f4505fcea6d66158ec1fc54b3469b5ccc410a (diff) | |
download | doubango-7ff6a247a8ec64673fa7920225b47a8b9224f078.zip doubango-7ff6a247a8ec64673fa7920225b47a8b9224f078.tar.gz |
Cleanly handle "MF_E_SHUTDOWN" error when an even is received while the session is shutting down
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/pluginWinMF/plugin_win_mf_producer_video.cxx | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/plugins/pluginWinMF/plugin_win_mf_producer_video.cxx b/plugins/pluginWinMF/plugin_win_mf_producer_video.cxx index 886fc45..f20f9e4 100644 --- a/plugins/pluginWinMF/plugin_win_mf_producer_video.cxx +++ b/plugins/pluginWinMF/plugin_win_mf_producer_video.cxx @@ -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); |