|
@@ -826,19 +826,8 @@ void* StartMediaPlayFunc(void* param)
|
|
|
{
|
|
|
rvcResourceParse_t ResourceList[MAX_LOCAL_MEDIAS] = { 0 };
|
|
|
size_t uCount = entity->m_mediaManage.GetPlayListByLocal(ResourceList, MAX_LOCAL_MEDIAS);
|
|
|
- //Dbg("uCount == %d", uCount);
|
|
|
- //for (int i = 0; i < uCount; i++)
|
|
|
- //{
|
|
|
- // rvcResourceParse_t item = ResourceList[i];
|
|
|
- // Dbg("%s:%d ResourceList[%d] address is 0x%0x.", __FUNCTION__, __LINE__, i, ResourceList[i]);
|
|
|
- // Dbg("item->type address is 0x%0x.", item.type);
|
|
|
- // Dbg("item->presourcePath address is 0x%0x.", item.strResourcePath);
|
|
|
- // Dbg("item->pvideoNames address is 0x%0x.", item.strvideoNames);
|
|
|
- // Dbg("play extend %c:%s, %s", item.type, item.strResourcePath, item.strvideoNames);
|
|
|
- //}
|
|
|
-
|
|
|
- if (0 == uCount)
|
|
|
- {
|
|
|
+
|
|
|
+ if (0 == uCount){
|
|
|
int64_t playThreadId = 0;
|
|
|
CMediaPlayConfig config = {0};
|
|
|
memcpy(&config, &(entity->m_Videos[entity->m_mediaParam.nCfgInx]), sizeof(CMediaPlayConfig));
|
|
@@ -848,29 +837,28 @@ void* StartMediaPlayFunc(void* param)
|
|
|
config.nWndY = entity->m_mediaParam.nWndY;
|
|
|
config.nWndWidth = entity->m_mediaParam.nWndWidth;
|
|
|
config.nWndHeight = entity->m_mediaParam.nWndHeight;
|
|
|
- if (IS_DEBUG)
|
|
|
- {
|
|
|
+ if (IS_DEBUG){
|
|
|
config.bFullScreen = false;
|
|
|
config.bPrimMonitor = true;
|
|
|
}
|
|
|
|
|
|
- if (!entity->GetLocalVideoVolume(0, config.nVolume))
|
|
|
- {
|
|
|
+ if (!entity->GetLocalVideoVolume(0, config.nVolume)){
|
|
|
config.nVolume = entity->m_defaultVolum;
|
|
|
}
|
|
|
- //Dbg("config.nVolume=%d while play local video.", config.nVolume);
|
|
|
|
|
|
struct tm* ptm = NULL;
|
|
|
time_t t = time(NULL);
|
|
|
ptm = localtime(&t);
|
|
|
TCHAR strNow[TIME_LEN] = {0};
|
|
|
sprintf(strNow, "%02d:%02d:%02d", ptm->tm_hour, ptm->tm_min, ptm->tm_sec);
|
|
|
- if (strcmp(strNow, config.strVideoRunTime_S) < 0 || strcmp(strNow, config.strVideoRunTime_E) >= 0)
|
|
|
- {
|
|
|
+ if (strcmp(strNow, config.strVideoRunTime_S) < 0 || strcmp(strNow, config.strVideoRunTime_E) >= 0){
|
|
|
Sleep(10000);
|
|
|
continue;
|
|
|
}
|
|
|
- entity->m_pMediaPlayer[entity->m_mediaParam.nCfgInx]->PlayMedia(config);
|
|
|
+
|
|
|
+ if (-1 == entity->m_pMediaPlayer[entity->m_mediaParam.nCfgInx]->PlayMedia(config)){
|
|
|
+ Sleep(60000);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
for (int i = 0; i < uCount && i < MAX_LOCAL_MEDIAS && entity->GetPlayFlag(); i++)
|
|
@@ -1011,9 +999,12 @@ void CLocalMediaPlayEntity::StartAudio(const char *pAudioNames)
|
|
|
#else
|
|
|
|
|
|
if (m_pMediaAudioPlayer->checkIsPlay()) {
|
|
|
- Dbg("aurrent is playing, wait for it.");
|
|
|
- //m_pMediaAudioPlayer->Close();
|
|
|
- pthread_join(m_uMediaPlayThreadId, NULL);
|
|
|
+ Dbg("current is playing, close it.");
|
|
|
+ if (0 != m_uMediaPlayThreadId){
|
|
|
+ m_pMediaAudioPlayer->Close();
|
|
|
+ m_uMediaPlayThreadId = 0;
|
|
|
+ Sleep(800);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
m_lastPlayAudio = pAudioNames;
|