|
@@ -223,9 +223,7 @@ int CMediaPlayer::Initialize_Player_Stat(rvc_media_player_param_t* pMedia_Player
|
|
|
m_hostapi->Debug(MEDIA_LOG_DEBUG, "player_stat_t struct malloc failed!");
|
|
|
return iRet;
|
|
|
}
|
|
|
- //m_player_stat->baudio_finished = false;
|
|
|
- //m_player_stat->bvideo_finished = false;
|
|
|
- //m_player_stat->bread_finished = false;
|
|
|
+
|
|
|
m_player_stat->buser_stop = false;
|
|
|
m_player_stat->rvc_hostapi = m_hostapi;
|
|
|
m_player_stat->prvc_cb = pMedia_Player->cb;
|
|
@@ -248,9 +246,12 @@ int CMediaPlayer::Initialize_Player_Stat(rvc_media_player_param_t* pMedia_Player
|
|
|
}
|
|
|
m_player_stat->uVolume = m_uvolume;
|
|
|
m_player_stat->uFilesCount = pMedia_Player->uFilesCount;
|
|
|
+ m_player_stat->icurrent_index = 0;
|
|
|
+ m_player_stat->iaudio_dec_index = 0;
|
|
|
for (size_t i = 0; i < pMedia_Player->uFilesCount; i++){
|
|
|
memcpy(m_player_stat->strPlayLists[i], pMedia_Player->strPlayLists[i], strlen(pMedia_Player->strPlayLists[i]));
|
|
|
}
|
|
|
+
|
|
|
if (0 == pMedia_Player->uFilesCount || NULL == m_player_stat->rvc_hostapi || NULL == m_player_stat->prvc_cb || NULL == m_player_stat->piconpath) {
|
|
|
UnInitialize_Player_Stat();
|
|
|
return iRet;
|
|
@@ -270,6 +271,12 @@ int CMediaPlayer::UnInitialize_Player_Stat()
|
|
|
return -1;
|
|
|
}
|
|
|
|
|
|
+ packet_queue_abort(&m_player_stat->video_pkt_queue, m_hostapi);
|
|
|
+ packet_queue_abort(&m_player_stat->audio_pkt_queue, m_hostapi);
|
|
|
+
|
|
|
+ frame_queue_signal(&m_player_stat->video_frm_queue);
|
|
|
+ frame_queue_signal(&m_player_stat->audio_frm_queue);
|
|
|
+
|
|
|
//if (NULL != m_player_stat->audio_decode_tid) {
|
|
|
// SDL_WaitThread(m_player_stat->audio_decode_tid, NULL);
|
|
|
// m_player_stat->audio_decode_tid = NULL;
|
|
@@ -501,11 +508,11 @@ int CMediaPlayer::StartMediaPlay()
|
|
|
|
|
|
m_hostapi->Debug(MEDIA_LOG_DEBUG, "after open_audio function.");
|
|
|
|
|
|
- packet_queue_abort(&m_player_stat->video_pkt_queue, m_hostapi);
|
|
|
- packet_queue_abort(&m_player_stat->audio_pkt_queue, m_hostapi);
|
|
|
+ //packet_queue_abort(&m_player_stat->video_pkt_queue, m_hostapi);
|
|
|
+ //packet_queue_abort(&m_player_stat->audio_pkt_queue, m_hostapi);
|
|
|
|
|
|
- frame_queue_signal(&m_player_stat->video_frm_queue);
|
|
|
- frame_queue_signal(&m_player_stat->audio_frm_queue);
|
|
|
+ //frame_queue_signal(&m_player_stat->video_frm_queue);
|
|
|
+ //frame_queue_signal(&m_player_stat->audio_frm_queue);
|
|
|
|
|
|
if (NULL != m_player_stat->audio_decode_tid) {
|
|
|
SDL_WaitThread(m_player_stat->audio_decode_tid, NULL);
|