|
@@ -1138,7 +1138,6 @@ void CLocalMediaPlayEntity::OnStarted()
|
|
|
GetFunction()->SubscribeLog(m_SubIDStopRecord, this, Log_Event, Severity_None, Error_IgnoreAll, LOG_EVT_UI_STOPREMOTERECORD, NULL, false);
|
|
|
|
|
|
if (eStand2sType == m_eDeviceType) {
|
|
|
-
|
|
|
#ifdef RVC_OS_WIN
|
|
|
m_scanThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)&qryMedia, this, 0, NULL);
|
|
|
if (NULL != m_scanThread)
|
|
@@ -1148,9 +1147,7 @@ void CLocalMediaPlayEntity::OnStarted()
|
|
|
if (0 != err) {
|
|
|
DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("create queryMedia thread failed.");
|
|
|
}
|
|
|
-
|
|
|
#endif // RVC_OS_WIN
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1363,7 +1360,7 @@ DWORD WINAPI MediaPlayThread(LPVOID param)
|
|
|
{
|
|
|
CLocalMediaPlayEntity *entity = (CLocalMediaPlayEntity*)param;
|
|
|
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Enter Windows Media Play Thread.");
|
|
|
+ DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("Enter Windows Media Play Thread.");
|
|
|
|
|
|
while (entity->GetPlayFlag())
|
|
|
{
|
|
@@ -1547,7 +1544,7 @@ DWORD WINAPI MediaPlayThread(LPVOID param)
|
|
|
entity->m_playThread = NULL;
|
|
|
}
|
|
|
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Exit MediaPlayThread.");
|
|
|
+ DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("Exit MediaPlayThread.");
|
|
|
|
|
|
return 0;
|
|
|
}
|
|
@@ -1703,8 +1700,11 @@ void* StartAudioPlayingThreadFunc(void* param)
|
|
|
if (0 != entity->m_pMediaAudioPlayer->PlayLocalAudio(pAudioNames)) {
|
|
|
DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("StartAudio failed, for %s is not exsit.", pAudioNames);
|
|
|
}
|
|
|
+
|
|
|
entity->m_uMediaPlayThreadId = 0;
|
|
|
|
|
|
+ DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("Exit Start Audio Playing Thread Function.");
|
|
|
+
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
@@ -1991,8 +1991,8 @@ void CLocalMediaPlayEntity::StartAudio(const char *pAudioNames)
|
|
|
DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("current is playing, close it.");
|
|
|
if (0 != m_uMediaPlayThreadId) {
|
|
|
m_pMediaAudioPlayer->Close();
|
|
|
- m_uMediaPlayThreadId = 0;
|
|
|
- usleep(500*1000);
|
|
|
+ pthread_join(m_uMediaPlayThreadId, NULL);
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -2357,11 +2357,10 @@ ErrorCodeEnum CLocalMediaPlayEntity::StartFFPlayerNotice(int nCfgInx, int nWndX,
|
|
|
DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("audio current is playing, close it.");
|
|
|
if (0 != m_uMediaPlayThreadId) {
|
|
|
m_pMediaAudioPlayer->Close();
|
|
|
- m_uMediaPlayThreadId = 0;
|
|
|
#ifdef RVC_OS_WIN
|
|
|
- Sleep(500);
|
|
|
+ WaitForSingleObject(m_uMediaPlayThreadId, INFINITE);
|
|
|
#else
|
|
|
- usleep(500*1000);
|
|
|
+ pthread_join(m_uMediaPlayThreadId, NULL);
|
|
|
#endif // RVC_OS_WI
|
|
|
}
|
|
|
}
|
|
@@ -2370,11 +2369,10 @@ ErrorCodeEnum CLocalMediaPlayEntity::StartFFPlayerNotice(int nCfgInx, int nWndX,
|
|
|
DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("video current is playing, close it.");
|
|
|
if (NULL != m_uNoticePlayThreadId) {
|
|
|
m_pMediaPlayer[nCfgInx]->Close();
|
|
|
- m_uNoticePlayThreadId = 0;
|
|
|
#ifdef RVC_OS_WIN
|
|
|
- Sleep(500);
|
|
|
+ WaitForSingleObject(m_uNoticePlayThreadId, INFINITE);
|
|
|
#else
|
|
|
- usleep(500 * 1000);
|
|
|
+ pthread_join(m_uNoticePlayThreadId, NULL);
|
|
|
#endif // RVC_OS_WI
|
|
|
}
|
|
|
}
|
|
@@ -2549,7 +2547,6 @@ bool CLocalMediaPlayEntity::GetLocalPicLogFlag()
|
|
|
|
|
|
void CLocalMediaPlayEntity::OnSelfTest(EntityTestEnum eTestType, CSmartPointer<ITransactionContext> pTransactionContext)
|
|
|
{
|
|
|
- DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("%s:%d, eTestType = %d.", __FUNCTION__, __LINE__, eTestType);
|
|
|
if (Test_ShakeHand == eTestType){
|
|
|
pTransactionContext->SendAnswer(Error_Succeed);
|
|
|
}
|