浏览代码

#IQRV #comment [localmediaplay]结局本地播放实体稳定性问题

陈礼鹏80274480 4 年之前
父节点
当前提交
c01b6e2e6a

+ 9 - 3
Module/mod_localmediaplay/mod_localmediaplay.cpp

@@ -859,7 +859,8 @@ void* StartMediaPlayFunc(void* param)
 	if (NULL == param){
 		return (void*)&iRet;
 	}
-	
+	Dbg("Enter Media Play Function.");
+
 	CLocalMediaPlayEntity* entity = (CLocalMediaPlayEntity*)param;
 	while (entity->GetPlayFlag())
 	{
@@ -895,10 +896,10 @@ void* StartMediaPlayFunc(void* param)
 				Sleep(10000);
 				continue;
 			}
-
 			if (-1 == entity->m_pMediaPlayer[entity->m_mediaParam.nCfgInx]->PlayMedia(config)){
 				Sleep(30*DEFAULT_SLEEP_TIME);
 			}
+			Sleep(800);
 		}
 
 		for (int i = 0; i < uCount && i < MAX_LOCAL_MEDIAS && entity->GetPlayFlag(); i++)
@@ -932,10 +933,14 @@ void* StartMediaPlayFunc(void* param)
 				strncpy(config.strFileNames[0], item.strvideoNames, strlen(item.strvideoNames));
 				strncpy(config.strVideoRunTime_S, "09:00:00", sizeof(config.strVideoRunTime_S));
 				strncpy(config.strVideoRunTime_E, "17:30:00", sizeof(config.strVideoRunTime_E));
-				if (-2 == entity->m_pMediaPlayer[entity->m_mediaParam.nCfgInx]->PlayMedia(config)){
+				int iPlayRet = entity->m_pMediaPlayer[entity->m_mediaParam.nCfgInx]->PlayMedia(config);
+				if (-2 == iPlayRet){
 					Sleep(DEFAULT_SLEEP_TIME);
 					continue;
 				}
+				if (-3 == iPlayRet) {
+					Sleep(DEFAULT_SLEEP_TIME/6);
+				}
 				Sleep(800);
 			}
 			else if ('P' == item.type)
@@ -981,6 +986,7 @@ void* StartMediaPlayFunc(void* param)
 			Sleep(30*DEFAULT_SLEEP_TIME);
 		}
 	}
+	Dbg("Leave Media Play Function.");
 	return (void*)&iRet;
 }
 

+ 1 - 1
Module/mod_localmediaplay/mod_localmediaplay.h

@@ -186,7 +186,7 @@ private:
 	vector<CMediaPlayConfig> m_Audios;
 	vector<CPicPlayConfig> m_defaultPic;
 	pthread_t m_uMediaPlayThreadId;
-	bool m_badplayflag;
+	volatile bool m_badplayflag;
 	bool m_scanexitflag;
 	CSimpleStringA m_strAudioOutDev;
 #endif // RVC_OS_WIN

+ 1 - 1
Other/libmediaplayer/audio.cpp

@@ -199,7 +199,7 @@ int open_audio_stream(player_stat_t *is)
     // 2. 创建音频解码线程
 	is->audio_decode_tid = SDL_CreateThread(audio_decode_thread, "audio decode thread", is);
 	if (NULL == is->audio_decode_tid) {
-		is->rvc_hostapi->Debug(MEDIA_LOG_DEBUG, "SDL_Create audio decode thread failed: %s.", SDL_GetError());
+		is->rvc_hostapi->Debug(MEDIA_LOG_ERROR, "SDL_Create audio decode thread failed: %s.", SDL_GetError());
 		return -1;
 	}
 	else {

+ 8 - 6
Other/libmediaplayer/demux.cpp

@@ -23,7 +23,7 @@ static int demux_init(player_stat_t *is)
 
 		p_fmt_ctx = avformat_alloc_context();
 		if (!p_fmt_ctx){
-			is->rvc_hostapi->Debug(MEDIA_LOG_DEBUG, "Could not allocate context.");
+			is->rvc_hostapi->Debug(MEDIA_LOG_ERROR, "Could not allocate context.");
 			ret = AVERROR(ENOMEM);
 			break;
 		}
@@ -36,7 +36,7 @@ static int demux_init(player_stat_t *is)
 		if (err < 0){
 			char buffer[RVC_MAX_BUFFER_LEN] = { 0 };
 			av_strerror(err, buffer, RVC_MAX_BUFFER_LEN);
-			is->rvc_hostapi->Debug(MEDIA_LOG_DEBUG, "avformat_open_input file %s failed %d(%s).", is->strPlayLists[index], err, buffer);
+			is->rvc_hostapi->Debug(MEDIA_LOG_ERROR, "avformat_open_input file %s failed %d(%s).", is->strPlayLists[index], err, buffer);
 			ret = -1;
 			break;
 		}
@@ -47,7 +47,9 @@ static int demux_init(player_stat_t *is)
 		//     ic->streams是一个指针数组,数组大小是pFormatCtx->nb_streams
 		err = avformat_find_stream_info(p_fmt_ctx, NULL);
 		if (err < 0){
-			is->rvc_hostapi->Debug(MEDIA_LOG_DEBUG, "%s avformat_find_stream_info() failed %d.", is->strPlayLists[index], err);
+			char strbuffer[RVC_MAX_BUFFER_LEN] = { 0 };
+			av_strerror(err, strbuffer, RVC_MAX_BUFFER_LEN);
+			is->rvc_hostapi->Debug(MEDIA_LOG_ERROR, "%s avformat_find_stream_info() failed %d(%s).", is->strPlayLists[index], err, strbuffer);
 			ret = -1;
 			break;
 		}
@@ -68,7 +70,7 @@ static int demux_init(player_stat_t *is)
 		}
 
 		if ((a_idx == -1 && v_idx == -1) || (eVideo_Type == is->eMType && v_idx == -1)){
-			is->rvc_hostapi->Debug(MEDIA_LOG_DEBUG, "%s can not find any audio/video stream.", is->strPlayLists[index]);
+			is->rvc_hostapi->Debug(MEDIA_LOG_ERROR, "Invalid file %s can not find any audio/video stream.", is->strPlayLists[index]);
 			ret = -1;
 			if (NULL != p_fmt_ctx){
 				avformat_close_input(&p_fmt_ctx);
@@ -185,13 +187,13 @@ static int demux_thread(void *arg)
 int open_demux(player_stat_t *is)
 {
     if (demux_init(is) != 0){
-		is->rvc_hostapi->Debug(MEDIA_LOG_DEBUG, "demux_init() failed.");
+		is->rvc_hostapi->Debug(MEDIA_LOG_ERROR, "demux_init() failed.");
         return -1;
     }
 
     is->read_tid = SDL_CreateThread(demux_thread, "demux_thread", is);
     if (is->read_tid == NULL){
-		is->rvc_hostapi->Debug(MEDIA_LOG_DEBUG, "SDL_CreateThread() failed: %s.", SDL_GetError());
+		is->rvc_hostapi->Debug(MEDIA_LOG_ERROR, "SDL_CreateThread() failed: %s.", SDL_GetError());
         return -1;
     }
 	else {

+ 8 - 16
Other/libmediaplayer/libmediaplayer.cpp

@@ -73,11 +73,9 @@ public:
 		memcpy(t_param.strPlayLists[0], strVideoName, strlen(strVideoName));
 		t_param.uFilesCount = 1;
 
-		if (0 == m_Player->InitParam(&t_param))
-		{
+		if (0 == m_Player->InitParam(&t_param)){
 			m_bisplaying = true;
-			m_Player->StartMediaPlay();
-			iRet = 0;
+			iRet = m_Player->StartMediaPlay();
 		}
 
 		return iRet;
@@ -145,7 +143,7 @@ public:
 		iRet = m_pHostApi->LoadPlayConfig(m_stPlayConfig);
 		m_stPlayConfig.eMode = LOCALAUDIO;
 		if (0 != iRet){
-			m_pHostApi->Debug(MEDIA_LOG_DEBUG, "Load WmpConfiguration failed while play local audio!");
+			m_pHostApi->Debug(MEDIA_LOG_ERROR, "Load WmpConfiguration failed while play local audio!");
 			return iRet;
 		}
 		else{
@@ -166,11 +164,10 @@ public:
 		if (0 == m_Player->InitParam(&t_param)){
 			m_pHostApi->Debug(MEDIA_LOG_DEBUG, "Player Init success!");
 			m_bisplaying = true;
-			m_Player->StartMediaPlay();
-			iRet = 0;
+			iRet = m_Player->StartMediaPlay();
 		}
 		else{
-			m_pHostApi->Debug(MEDIA_LOG_DEBUG, "Player Init failed!");
+			m_pHostApi->Debug(MEDIA_LOG_ERROR, "Player Init failed!");
 		}
 		return iRet;
 	}
@@ -257,8 +254,7 @@ public:
 
 		if (0 == m_Player->InitParam(&t_param)){
 			m_bisplaying = true;
-			m_Player->StartMediaPlay();
-			iRet = 0;
+			iRet = m_Player->StartMediaPlay();
 		}
 		else{
 			m_pHostApi->Debug(MEDIA_LOG_DEBUG, "player init failed!");
@@ -281,15 +277,13 @@ public:
 	int StartPlayMedia(CMediaPlayConfig& config)
 	{
 		int iRet = -1;
-
 		memcpy(&m_stPlayConfig, &config, sizeof(CMediaPlayConfig));
-
 		// 判断当前时间是否允许播放
 		struct tm* ptm = NULL;
 		time_t t = time(NULL);
 		ptm = localtime(&t);
 		char strNow[TIME_LEN] = { 0 };
-		sprintf(strNow, "%02d:%02d:%02d", ptm->tm_hour, ptm->tm_min, ptm->tm_sec);
+		snprintf(strNow, TIME_LEN, "%02d:%02d:%02d", ptm->tm_hour, ptm->tm_min, ptm->tm_sec);
 		if (strcmp(strNow, m_stPlayConfig.strVideoRunTime_S) < 0 || strcmp(strNow, m_stPlayConfig.strVideoRunTime_E) >= 0)
 		{
 			m_pHostApi->Debug(MEDIA_LOG_DEBUG, "Now is %s, video play start time is %s, video play stop time is %s, play video rejected!", strNow, m_stPlayConfig.strVideoRunTime_S, m_stPlayConfig.strVideoRunTime_E);
@@ -327,13 +321,11 @@ public:
 		m_Player->SetVolume(config.nVolume);
 		if (0 == m_Player->InitParam(&t_param)) {
 			m_bisplaying = true;
-			m_Player->StartMediaPlay();
-			iRet = 0;
+			iRet = m_Player->StartMediaPlay();
 		}
 		else {
 			m_pHostApi->Debug(MEDIA_LOG_DEBUG, "Player Init failed!");
 		}
-
 		return iRet;
 	}
 

+ 36 - 22
Other/libmediaplayer/player.cpp

@@ -191,8 +191,6 @@ bool CMediaPlayer::SetFinishedFlag()
 		}
 	}
 	
-
-
 	return true;
 }
 
@@ -264,9 +262,32 @@ int CMediaPlayer::UnInitialize_Player_Stat()
 		return -1;
 	}
 
-	SDL_WaitThread(m_player_stat->read_tid, NULL);
-	m_hostapi->Debug(MEDIA_LOG_DEBUG, "demux thread finished.");
-	
+	if (NULL != m_player_stat->audio_decode_tid) {
+		SDL_WaitThread(m_player_stat->audio_decode_tid, NULL);
+		m_player_stat->audio_decode_tid = NULL;
+		m_hostapi->Debug(MEDIA_LOG_DEBUG, "audio decode thread finished.");
+	}
+
+	if (m_player_stat->eMType == eVideo_Type) {
+		if (NULL != m_player_stat->video_decode_tid) {
+			SDL_WaitThread(m_player_stat->video_decode_tid, NULL);
+			m_player_stat->video_decode_tid = NULL;
+			m_hostapi->Debug(MEDIA_LOG_DEBUG, "video decode thread finished.");
+		}
+
+		if (NULL != m_player_stat->video_playing_tid) {
+			SDL_WaitThread(m_player_stat->video_playing_tid, NULL);
+			m_player_stat->video_playing_tid = NULL;
+			m_hostapi->Debug(MEDIA_LOG_DEBUG, "video playing thread finished.");
+		}
+	}
+
+	if (NULL != m_player_stat->read_tid){
+		SDL_WaitThread(m_player_stat->read_tid, NULL);
+		m_player_stat->read_tid = NULL;
+		m_hostapi->Debug(MEDIA_LOG_DEBUG, "demux thread finished.");
+	}
+
 	for (int index = 0; index < m_player_stat->uFilesCount; index++) {
 		if (NULL != m_player_stat->p_fmt_ctx[index]) {
 			avformat_close_input(&m_player_stat->p_fmt_ctx[index]);
@@ -290,20 +311,7 @@ int CMediaPlayer::UnInitialize_Player_Stat()
 
 	SDL_DestroyCond(m_player_stat->continue_read_thread);
 
-	if (NULL != m_player_stat->audio_decode_tid){
-		SDL_WaitThread(m_player_stat->audio_decode_tid, NULL);
-	}
 	if (m_player_stat->eMType == eVideo_Type) {
-		if (NULL != m_player_stat->video_decode_tid){
-			SDL_WaitThread(m_player_stat->video_decode_tid, NULL);
-			m_hostapi->Debug(MEDIA_LOG_DEBUG, "video decode thread finished.");
-		}
-
-		if (NULL != m_player_stat->video_playing_tid) {
-			SDL_WaitThread(m_player_stat->video_playing_tid, NULL);
-			m_hostapi->Debug(MEDIA_LOG_DEBUG, "video playing thread finished.");
-		}
-
 		for (int index = 0; index < m_player_stat->uFilesCount; index++) {
 			if (NULL != m_player_stat->img_convert_ctx[index]) {
 				sws_freeContext(m_player_stat->img_convert_ctx[index]);
@@ -455,8 +463,9 @@ bool CMediaPlayer::GetPlayingFlag()
 }
 
 
-void CMediaPlayer::StartMediaPlay()
+int CMediaPlayer::StartMediaPlay()
 {
+	int iRet = -1;
 	if (0 == open_demux(m_player_stat)){
 		m_hostapi->Debug(MEDIA_LOG_DEBUG, "open_demux function call success.");
 	}
@@ -464,7 +473,8 @@ void CMediaPlayer::StartMediaPlay()
 		m_hostapi->Debug(MEDIA_LOG_ERROR, "open_demux function call failed.");
 		av_free(m_player_stat);
 		m_player_stat = NULL;
-		return;
+		iRet = -3;
+		return iRet;
 	}
 
 	m_hostapi->Debug(MEDIA_LOG_DEBUG, "set playing flag to true.");
@@ -486,7 +496,9 @@ void CMediaPlayer::StartMediaPlay()
 
 	ExitMediaPlayingThread();
 
-	m_hostapi->Debug(MEDIA_LOG_DEBUG, "%s:%d exit.", __FUNCTION__, __LINE__);
+	iRet = 0;
+	
+	return iRet;
 }
 
 
@@ -525,7 +537,7 @@ int CMediaPlayer::ExitMediaPlayingThread()
 		return iRet;
 	}
 
-	m_hostapi->Debug(MEDIA_LOG_DEBUG, "ExitMediaPlayingThread called.");
+	m_hostapi->Debug(MEDIA_LOG_DEBUG, "enter ExitMediaPlayingThread call.");
 
 	if(eVideo_Type == m_player_stat->eMType){
 		if (m_player_stat->sdl_video.texture) {
@@ -553,6 +565,8 @@ int CMediaPlayer::ExitMediaPlayingThread()
 	m_bplaying = false;
 
 	iRet = 0;
+	
+	m_hostapi->Debug(MEDIA_LOG_DEBUG, "Leave ExitMediaPlayingThread call.");
 
 	return iRet;
 }

+ 1 - 1
Other/libmediaplayer/player.h

@@ -275,7 +275,7 @@ public:
 	int UnInitialize_Player_Stat();
 	int SetVolume(uint8_t uVolume);
 	bool GetPlayingFlag();
-	void StartMediaPlay();
+	int StartMediaPlay();
 	int StopMediaPlay();
 	int ExitMediaPlayingThread();
 	int64_t GetMediaPlayingThreadId();

+ 17 - 20
Other/libmediaplayer/video.cpp

@@ -41,7 +41,7 @@ static int video_decode_frame(AVCodecContext *p_codec_ctx, packet_queue_t *p_pkt
     
     while (0 == p_pkt_queue->abort_flag)
     {
-		AVPacket pkt;
+		AVPacket pkt = {0};
 		av_init_packet(&pkt);
         while (0 == p_pkt_queue->abort_flag)
         {
@@ -63,7 +63,6 @@ static int video_decode_frame(AVCodecContext *p_codec_ctx, packet_queue_t *p_pkt
                 else if (ret == AVERROR(EAGAIN))
                 {
 					//hostapi->Debug(MEDIA_LOG_DEBUG,"video avcodec_receive_frame(): output is not available in this state - " "user must try to send new input");
-					av_usleep(2);
                     break;
                 }
                 else
@@ -95,8 +94,7 @@ static int video_decode_frame(AVCodecContext *p_codec_ctx, packet_queue_t *p_pkt
             //    pkt.pos变量可以标识当前packet在视频文件中的地址偏移
 			int isend_ret = -1;
 			isend_ret = avcodec_send_packet(p_codec_ctx, &pkt);
-			av_usleep(2);
-			//hostapi->Debug(MEDIA_LOG_DEBUG, "%s:%d after avcodec_send_packet.", __FUNCTION__, __LINE__);
+			
 			if (0 != isend_ret){
 				if (AVERROR(EAGAIN) == isend_ret) {
 					hostapi->Debug(MEDIA_LOG_DEBUG, "receive_frame and send_packet both returned EAGAIN, which is an API violation.");
@@ -383,7 +381,7 @@ static int open_video_playing(void* arg)
 	for (size_t index = 0; index < is->uFilesCount; index++) {
 		is->p_frm_yuv[index] = av_frame_alloc();
 		if (is->p_frm_yuv[index] == NULL) {
-			is->rvc_hostapi->Debug(MEDIA_LOG_DEBUG, "av_frame_alloc() for p_frm_raw failed");
+			is->rvc_hostapi->Debug(MEDIA_LOG_ERROR, "av_frame_alloc() for p_frm_raw failed");
 			return -1;
 		}
 
@@ -403,7 +401,7 @@ static int open_video_playing(void* arg)
 		// buffer将作为p_frm_yuv的视频数据缓冲区
 		buffer = (uint8_t*)av_malloc(buf_size);
 		if (buffer == NULL) {
-			is->rvc_hostapi->Debug(MEDIA_LOG_DEBUG, "av_malloc() for buffer failed!");
+			is->rvc_hostapi->Debug(MEDIA_LOG_ERROR, "av_malloc() for buffer failed!");
 			return -1;
 		}
 		is->p_video_buffer[index] = buffer;
@@ -418,7 +416,7 @@ static int open_video_playing(void* arg)
 		);
 
 		if (ret < 0) {
-			is->rvc_hostapi->Debug(MEDIA_LOG_DEBUG, "av_image_fill_arrays() failed %d", ret);
+			is->rvc_hostapi->Debug(MEDIA_LOG_ERROR, "av_image_fill_arrays() failed %d", ret);
 			return -1;;
 		}
 
@@ -441,11 +439,11 @@ static int open_video_playing(void* arg)
 		);
 
 		if (is->img_convert_ctx[index] == NULL) {
-			is->rvc_hostapi->Debug(MEDIA_LOG_DEBUG, "sws_getContext() failed");
+			is->rvc_hostapi->Debug(MEDIA_LOG_ERROR, "sws_getContext() failed");
 			return -1;
 		}
 		else {
-			is->rvc_hostapi->Debug(MEDIA_LOG_DEBUG, "%s:%d is->img_convert_ctx[%d] = 0x%0x", __FUNCTION__, __LINE__, index, is->img_convert_ctx[index]);
+			is->rvc_hostapi->Debug(MEDIA_LOG_DEBUG, "%s:%d is->img_convert_ctx[%d] = 0x%08x", __FUNCTION__, __LINE__, index, is->img_convert_ctx[index]);
 		}
 
 		
@@ -473,7 +471,7 @@ static int open_video_playing(void* arg)
 		);
 
 		if (is->sdl_video.window == NULL) {
-			is->rvc_hostapi->Debug(MEDIA_LOG_DEBUG, "SDL_CreateWindow() failed: %s.", SDL_GetError());
+			is->rvc_hostapi->Debug(MEDIA_LOG_ERROR, "SDL_CreateWindow() failed: %s.", SDL_GetError());
 			return -1;
 		}
 
@@ -488,7 +486,7 @@ static int open_video_playing(void* arg)
 		if (NULL != is->piconpath) {
 			IconSurface = SDL_LoadBMP(is->piconpath);
 			if (NULL == IconSurface) {
-				is->rvc_hostapi->Debug(MEDIA_LOG_DEBUG, "SDL_LoadBMP(%s) failed: %s", is->piconpath, SDL_GetError());
+				is->rvc_hostapi->Debug(MEDIA_LOG_ERROR, "SDL_LoadBMP(%s) failed: %s", is->piconpath, SDL_GetError());
 			}
 			else {
 				SDL_SetWindowIcon(is->sdl_video.window, IconSurface);
@@ -501,7 +499,7 @@ static int open_video_playing(void* arg)
 		is->sdl_video.renderer = SDL_CreateRenderer(is->sdl_video.window, -1, 0);
 		if (is->sdl_video.renderer == NULL)
 		{
-			is->rvc_hostapi->Debug(MEDIA_LOG_DEBUG, "SDL_CreateRenderer() failed: %s", SDL_GetError());
+			is->rvc_hostapi->Debug(MEDIA_LOG_ERROR, "SDL_CreateRenderer() failed: %s", SDL_GetError());
 			return -1;
 		}
 
@@ -516,13 +514,13 @@ static int open_video_playing(void* arg)
 
 		if (is->sdl_video.texture == NULL)
 		{
-			is->rvc_hostapi->Debug(MEDIA_LOG_DEBUG, "SDL_CreateTexture() failed: %s", SDL_GetError());
+			is->rvc_hostapi->Debug(MEDIA_LOG_ERROR, "SDL_CreateTexture() failed: %s", SDL_GetError());
 			return -1;
 		}
 
 		is->video_playing_tid = SDL_CreateThread(video_playing_thread, "video playing thread", is);
 		if (NULL == is->video_playing_tid) {
-			is->rvc_hostapi->Debug(MEDIA_LOG_DEBUG, "SDL_Create video playing thread failed: %s.", SDL_GetError());
+			is->rvc_hostapi->Debug(MEDIA_LOG_ERROR, "SDL_Create video playing thread failed: %s.", SDL_GetError());
 			return -1;
 		}
 		else {
@@ -550,7 +548,7 @@ static int open_video_stream(player_stat_t *is)
 		// 1.2 获取解码器
 		p_codec = avcodec_find_decoder(p_codec_par->codec_id);
 		if (p_codec == NULL) {
-			is->rvc_hostapi->Debug(MEDIA_LOG_DEBUG, "Cann't find codec!");
+			is->rvc_hostapi->Debug(MEDIA_LOG_ERROR, "Cann't find codec!");
 			return ret;
 		}
 
@@ -558,29 +556,28 @@ static int open_video_stream(player_stat_t *is)
 		// 1.3.1 p_codec_ctx初始化:分配结构体,使用p_codec初始化相应成员为默认值
 		p_codec_ctx = avcodec_alloc_context3(p_codec);
 		if (p_codec_ctx == NULL) {
-			is->rvc_hostapi->Debug(MEDIA_LOG_DEBUG, "avcodec_alloc_context3() failed");
+			is->rvc_hostapi->Debug(MEDIA_LOG_ERROR, "avcodec_alloc_context3() failed");
 			return ret;
 		}
 		// 1.3.2 p_codec_ctx初始化:p_codec_par ==> p_codec_ctx,初始化相应成员
 		ret = avcodec_parameters_to_context(p_codec_ctx, p_codec_par);
 		if (ret < 0) {
-			is->rvc_hostapi->Debug(MEDIA_LOG_DEBUG, "avcodec_parameters_to_context() failed");
+			is->rvc_hostapi->Debug(MEDIA_LOG_ERROR, "avcodec_parameters_to_context() failed");
 			return ret;
 		}
 		// 1.3.3 p_codec_ctx初始化:使用p_codec初始化p_codec_ctx,初始化完成
 		ret = avcodec_open2(p_codec_ctx, p_codec, NULL);
 		if (ret < 0) {
-			is->rvc_hostapi->Debug(MEDIA_LOG_DEBUG, "avcodec_open2() failed %d", ret);
+			is->rvc_hostapi->Debug(MEDIA_LOG_ERROR, "avcodec_open2() failed %d", ret);
 			return ret;
 		}
-
 		is->p_vcodec_ctx[index] = p_codec_ctx;
 	}
 
     // 2. 创建视频解码线程
 	is->video_decode_tid = SDL_CreateThread(video_decode_thread, "video decode thread", is);
 	if (NULL == is->video_decode_tid) {
-		is->rvc_hostapi->Debug(MEDIA_LOG_DEBUG, "SDL_Create video decode thread failed: %s.", SDL_GetError());
+		is->rvc_hostapi->Debug(MEDIA_LOG_ERROR, "SDL_Create video decode thread failed: %s.", SDL_GetError());
 		return -1;
 	}
 	else {