瀏覽代碼

Z991239-5614 #comment WIN版支持下摄像头回显

80274480 1 年之前
父節點
當前提交
27d617a416

+ 2 - 115
Module/mod_sipphone/endpoint.cpp

@@ -806,10 +806,6 @@ static void negotiate_sdp(endpoint_call_t *call, const sdp_session_t *local_sdp,
 		unsigned int hash_code = hash_media_desc(&audio_desc);
 		if (hash_code != call->last_media_desc_hash) 
 		{
-			char str_local[RVC_MAX_IP_LEN] = {0};
-			char str_remote[RVC_MAX_IP_LEN] = {0};
-			translate_ipaddr_from_int(str_local, RVC_MAX_IP_LEN, audio_desc.local_ip);
-			translate_ipaddr_from_int(str_remote, RVC_MAX_IP_LEN, audio_desc.remote_ip);
 			endpoint_media_update_audio(call, &audio_desc, call->ep->curr_audio_dev_type);
 			call->last_media_desc_hash = hash_code;
 			//char strmsg[MAX_PATH] = {0};
@@ -823,11 +819,6 @@ static void negotiate_sdp(endpoint_call_t *call, const sdp_session_t *local_sdp,
 		unsigned int hash_code = hash_media_desc(&video_desc);
 		if (hash_code != call->last_media_desc_hash) 
 		{
-			char str_local[128] = {0};
-			char str_remote[128] = {0};
-			translate_ipaddr_from_int(str_local, 128, video_desc.local_ip);
-			translate_ipaddr_from_int(str_remote, 128, video_desc.remote_ip);
-
 			call->sdpvieo_desc.local_pt = video_desc.local_pt;
 			call->sdpvieo_desc.local_rtp_ip = video_desc.local_ip;
 			call->sdpvieo_desc.local_rtp_port = video_desc.local_port;
@@ -1472,13 +1463,7 @@ int endpoint_call_start_video(endpoint_call_t *call, unsigned long remote_ip, in
 	int local_view_x, int local_view_y, int local_view_cx, int local_view_cy, 
 	int remote_view_x, int remote_view_y, int remote_view_cx, int remote_view_cy,
 	int local_move, int remote_move, video_session_callback_t* cb)
-{
-	char local_ip_str[RVC_MAX_IP_LEN]={0};
-	char remtote_ip_str[RVC_MAX_IP_LEN]={0};
-
-	translate_ipaddr_from_int(local_ip_str, RVC_MAX_IP_LEN, local_ip);
-	translate_ipaddr_from_int(remtote_ip_str, RVC_MAX_IP_LEN, remote_ip);
-	
+{	
 	if (call) 
 	{
 		int i = 0;
@@ -1510,16 +1495,10 @@ int endpoint_call_start_video(endpoint_call_t *call, unsigned long remote_ip, in
 		video_desc.param[i++] = remote_view_cy;
 		video_desc.param[i++] = remote_width;
 		video_desc.param[i++] = remote_height;
-		//add by clp 20190823
 		video_desc.param[i++] = local_move;
 		video_desc.param[i++] = remote_move;
 		endpoint_media_update_video(call, &video_desc, cb);
 
-		char str_local_ip[RVC_MAX_IP_LEN]={0};
-		char str_remtote_ip[RVC_MAX_IP_LEN]={0};
-		translate_ipaddr_from_int(str_local_ip, RVC_MAX_IP_LEN,video_desc.local_ip);
-		translate_ipaddr_from_int(str_remtote_ip, RVC_MAX_IP_LEN, video_desc.remote_ip);
-
 		return 0;
 	} 
 	else 
@@ -1530,12 +1509,6 @@ int endpoint_call_start_video(endpoint_call_t *call, unsigned long remote_ip, in
 #else
 int endpoint_call_start_video(endpoint_call_t* call, endpoint_call_param_t* pcallparam, rvc_video_render_callback_t* render_cb)
 {
-	char local_ip_str[RVC_MAX_IP_LEN]={0};
-	char remtote_ip_str[RVC_MAX_IP_LEN]={0};
-	
-	translate_ipaddr_from_int(local_ip_str, RVC_MAX_IP_LEN, pcallparam->local_ip);
-	translate_ipaddr_from_int(remtote_ip_str, RVC_MAX_IP_LEN, pcallparam->remote_ip);
-	
 	if (call) 
 	{
 		int i = 0;
@@ -1562,11 +1535,6 @@ int endpoint_call_start_video(endpoint_call_t* call, endpoint_call_param_t* pcal
 		video_desc.param[i++] = pcallparam->remote_height;
 		endpoint_media_update_video(call, &video_desc, render_cb);
 
-		char str_local_ip[RVC_MAX_IP_LEN]={0};
-		char str_remtote_ip[RVC_MAX_IP_LEN]={0};
-		translate_ipaddr_from_int(str_local_ip, RVC_MAX_IP_LEN,video_desc.local_ip);
-		translate_ipaddr_from_int(str_remtote_ip, RVC_MAX_IP_LEN, video_desc.remote_ip);
-
 		return 0;
 	} 
 	else 
@@ -1600,67 +1568,6 @@ int endpoint_call_stop_double_record_broadcast_video()
 }
 
 
-int local_play_start_video(endpoint_call_t *call,int local_view_x, int local_view_y, int local_view_cx, int local_view_cy, int local_move, video_session_callback_t* cb)
-{
-	int rc;
-	endpoint_conf_t *ep_conf = &call->ep->conf;
-	if (call->video) 
-	{
-		video_session_destroy(call->video);
-		call->video = NULL;
-	}
-	video_session_conf_t video_conf = {0};
-	video_conf.bit_rate = 256 * 1024;
-	video_conf.local_rtp_ip = 0;
-	video_conf.local_rtp_port = 0;
-	video_conf.local_video_view_x = local_view_x;
-	video_conf.local_video_view_y = local_view_y;
-	video_conf.local_video_view_cx = local_view_cx;
-	video_conf.local_video_view_cy = local_view_cy;
-	video_conf.local_move = local_move;
-	video_conf.mtu = ep_conf->mtu;
-	video_conf.video_quant = ep_conf->quant;
-	video_conf.remote_rtp_ip = 0;
-	video_conf.remote_rtp_port = 0;
-	video_conf.remote_video_view_x = 0;
-	video_conf.remote_video_view_y = 0;
-	video_conf.remote_video_view_cx = 0;
-	video_conf.remote_video_view_cy = 0;
-	video_conf.remote_video_width = 0;
-	video_conf.remote_video_height = 0;
-	video_conf.ref_active_camera = call->ep->conf.ref_active_camera;
-	video_conf.ref_camera_switch = call->ep->conf.ref_camera_switch;
-	video_conf.ref_camera_state = call->ep->conf.ref_camera_state;
-	video_conf.ref_window_state = call->ep->conf.ref_window_state;
-	video_conf.ref_active_img = call->ep->conf.ref_active_img;
-	video_conf.ref_Is_ActiveInspect = call->ep->conf.ref_Is_ActiveInspect;
-	video_conf.ref_Is_showPersonArea = call->ep->conf.ref_Is_showPersonArea;
-	video_conf.ref_Is_showRecordArea = call->ep->conf.ref_Is_showRecordArea;
-	video_conf.camera_count = call->ep->conf.camera_count;
-	video_conf.screen_count = call->ep->conf.screen_count;
-	video_conf.eDeviceType = call->eDeviceType;
-	video_conf.video_echo_cb = cb;
-	video_conf.ilocal_wind_flags = VIDEOPLAYER_FLAG_PULL|VIDEOPLAYER_FLAG_CHECKTOP|VIDEOPLAYER_FLAG_ZOOMOUTSIZE;
-	video_conf.iremote_wind_flags = VIDEOPLAYER_FLAG_PUSH|VIDEOPLAYER_FLAG_CHECKTOP;
-	video_conf.eType = (eVideoRenderType)call->ep->conf.irendertype;
-	rc = Local_video_session_create(&video_conf, &call->video);
-	if (rc != 0) 
-	{
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("create video session failed! rc = %d", rc);
-		return -1;
-	}
-	rc = video_session_start(call->video);
-	if (rc != 0) 
-	{
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("start video session failed! rc = %d", rc);
-		video_session_destroy(call->video);
-		call->video = NULL;
-		return -1;
-	}
-	return 0;
-}
-
-
 int local_remote_show_video(endpoint_call_t *call,int local_view_x, int local_view_y, int local_view_cx, int local_view_cy,int remote_view_x, int remote_view_y, int remote_view_cx, int remote_view_cy, int local_move, int remote_move, video_session_callback_t* cb)
 {
 	int rc;
@@ -1711,7 +1618,7 @@ int local_remote_show_video(endpoint_call_t *call,int local_view_x, int local_vi
 	video_conf.ilocal_wind_flags = VIDEOPLAYER_FLAG_PULL|VIDEOPLAYER_FLAG_CHECKTOP;
 	video_conf.iremote_wind_flags = VIDEOPLAYER_FLAG_PUSH|VIDEOPLAYER_FLAG_CHECKTOP;
 	video_conf.eType = (eVideoRenderType)call->ep->conf.irendertype;
-	rc = Local_video_session_create(&video_conf, &call->video, true);
+	rc = local_video_session_create(&video_conf, &call->video, true);
 	if (rc != 0){
 		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("create video session failed! rc = %d", rc);
 		return -1;
@@ -1754,24 +1661,4 @@ static void __endpoint_call_destroy(endpoint_call_t *call)
 }
 
 
-int translate_ipaddr_from_int(char* strdst, unsigned ulen, unsigned long uip)
-{
-	int iret = -1;
-	if (NULL == strdst){
-		return iret;
-	}
-
-	char* pstr_ip = inet_ntoa(__lton(uip));
-	size_t ulen_ip = 0;
-	if (NULL != pstr_ip){
-		ulen_ip = strlen(pstr_ip);
-		if (ulen_ip < ulen){
-			memcpy(strdst, pstr_ip, ulen_ip);
-			iret = 0;
-		}
-	}
-	return iret;
-}
-
-
 IMPLEMENT_REF_COUNT_MT_STATIC(endpoint_call, endpoint_call_t, ref_cnt, __endpoint_call_destroy)

+ 0 - 3
Module/mod_sipphone/endpoint.h

@@ -143,17 +143,14 @@ int endpoint_call_start_video(endpoint_call_t* call, unsigned long remote_ip, in
 
 int endpoint_call_stop_video(endpoint_call_t* call);
 int endpoint_call_stop_double_record_broadcast_video();
-int local_play_start_video(endpoint_call_t* call, int local_view_x, int local_view_y, int local_view_cx, int local_view_cy, int local_move, video_session_callback_t* cb);
 int local_play_stop_video(endpoint_call_t* call);
 int local_remote_show_video(endpoint_call_t* call, int local_view_x, int local_view_y, int local_view_cx, int local_view_cy, int remote_view_x, int remote_view_y, int remote_view_cx, int remote_view_cy, int local_move, int remote_move, video_session_callback_t* cb);
 
 void terminatedcall(endpoint_call_t* call);
-int translate_ipaddr_from_int(char* strdst, size_t ulen, unsigned long uip);
 #else
 int endpoint_call_start_video(endpoint_call_t* call, endpoint_call_param_t* pcallparam, rvc_video_render_callback_t* render_cb);
 int endpoint_call_stop_video(endpoint_call_t* call);
 void terminatedcall(endpoint_call_t* call);
-int translate_ipaddr_from_int(char* strdst, unsigned ulen, unsigned long uip);
 #endif //_WIN32
 
 #endif // ENDPOINT_H

+ 11 - 19
Module/mod_sipphone/mod_sipphone.cpp

@@ -2510,24 +2510,19 @@ void CSIPPhoneSession::Handle_StartVideo( SpOnewayCallContext<PhoneService_Start
 	pCmd->start = true;
 	pCmd->local_hwd_move = 0;
 	pCmd->remote_hwd_move = 0;
+
 #ifdef RVC_OS_WIN
-	if(!(ctx->Info.remote_view_x||ctx->Info.remote_view_y||ctx->Info.remote_view_cx||ctx->Info.remote_view_cy||ctx->Info.remote_width||ctx->Info.remote_height))
-	{
-		m_VideoWindowPlayType = eOnly_Local_Video;
-	}
-	else
-	{
-		m_VideoWindowPlayType = eOnline_Mode_Video;
-		if (0 == ctx->Info.remote_port){
-			m_VideoWindowPlayType = eBoth_Local_Remote_Video;
-			m_pEntity->m_nCallType = NORMAL_CALLTYPE;
-			if (NULL == m_pEntity->GetEndpoint())
-			{
-				m_pEntity->InitEndpoint();
-			}
+	m_VideoWindowPlayType = eOnline_Mode_Video;
+	if (0 == ctx->Info.remote_port){
+		m_VideoWindowPlayType = eBoth_Local_Remote_Video;
+		m_pEntity->m_nCallType = NORMAL_CALLTYPE;
+		if (NULL == m_pEntity->GetEndpoint())
+		{
+			m_pEntity->InitEndpoint();
 		}
 	}
 #endif
+
 	pCmd->local_ip = inet_addr(m_pEntity->m_localip);
 	pCmd->local_port = REC_COMMON_VIDEO_PORT;
 	pCmd->remote_ip = inet_addr(ctx->Info.remote_ip);
@@ -2875,7 +2870,7 @@ void CSIPPhoneSession::control_video( ControlVideoCommand_t *pCmd )
 		else 
 		{
 			//双录第一阶段结束录像,销毁call资源
-			if ((eOnly_Local_Video == m_VideoWindowPlayType) || (eBoth_Local_Remote_Video == m_VideoWindowPlayType && m_pEntity->m_nCallType != DOUBLERECORD_CALLTYPE ))
+			if (eBoth_Local_Remote_Video == m_VideoWindowPlayType && m_pEntity->m_nCallType != DOUBLERECORD_CALLTYPE)
 			{
 				local_play_stop_video(m_pCall);
 				endpoint_call_destroy(m_pCall);
@@ -2905,10 +2900,7 @@ void CSIPPhoneSession::control_video( ControlVideoCommand_t *pCmd )
 
 			m_pCall = endpoint_call_create(m_pEntity->GetEndpoint(), &t_callparam, &cb);
 			
-			if (eOnly_Local_Video == m_VideoWindowPlayType){
-				local_play_start_video(m_pCall,pCmd->local_view_x, pCmd->local_view_y, pCmd->local_view_cx, pCmd->local_view_cy, pCmd->local_hwd_move, &m_cb_video_box_move);
-			}
-			else if (eBoth_Local_Remote_Video == m_VideoWindowPlayType){
+		 if (eBoth_Local_Remote_Video == m_VideoWindowPlayType){
 				local_remote_show_video(m_pCall,pCmd->local_view_x, pCmd->local_view_y, pCmd->local_view_cx, pCmd->local_view_cy,pCmd->remote_view_x, pCmd->remote_view_y, pCmd->remote_view_cx, pCmd->remote_view_cy, pCmd->local_hwd_move, pCmd->remote_hwd_move,&m_cb_video_box_move);
 			}
 		}

+ 0 - 1
Module/mod_sipphone/mod_sipphone.h

@@ -121,7 +121,6 @@ enum ePickupMicrophoneState
 /* 0:online local and remote video window, 1:only local video window, 2:both local and remote window */
 enum eShowVideoWindowType{
 	eOnline_Mode_Video,
-	eOnly_Local_Video,
 	eBoth_Local_Remote_Video
 };
 

+ 0 - 5
Module/mod_sipphone/unix/video_session.cpp

@@ -1758,11 +1758,6 @@ int video_session_create(const video_session_conf_t *conf, video_session_t **p_s
 	video_session_t *session = ZALLOC_T(video_session_t);
 	if (session) 
 	{
-		char str_local[MAX_PATH_SIZE] = {0};
-		char str_remote[MAX_PATH_SIZE] = {0};
-		translate_ipaddr_from_int(str_local, MAX_PATH_SIZE, conf->local_rtp_ip);
-		translate_ipaddr_from_int(str_remote, MAX_PATH_SIZE, conf->remote_rtp_ip);
-
 		memcpy(&session->conf, conf, sizeof(video_session_conf_t));
 		//session->bshow_remote = false;
 		//session->ilast_windstae = 0;

+ 1 - 1
Module/mod_sipphone/video_session.h

@@ -121,7 +121,7 @@ struct video_session_s
 	picture_record_t* pic_record;
 };
 
-int Local_video_session_create(const video_session_conf_t* conf, video_session_t** p_session, bool bremote = false);
+int local_video_session_create(const video_session_conf_t* conf, video_session_t** p_session, bool bremote = false);
 void double_record_broadcast_video_session_stop();
 #else
 typedef struct video_session_t video_session_t;

+ 13 - 13
Module/mod_sipphone/win/video_session.cpp

@@ -375,7 +375,7 @@ static int on_rx_frame(video_frame *frame, void *user_data)
 
 			int rc = videoplayer_queue_frame(session->remote_player, frame, &__delete_frame, NULL);
 			if (rc == 0) {
-				used = TRUE;
+				used = 1;
 			}
 		}
 	}
@@ -471,7 +471,7 @@ static int on_pull(videoplayer_t *player, void *user_data, video_frame **frame)
 		tmp_frame_preview = video_frame_new(REC_COMMON_VIDEO_PREVIEW_WIDTH, REC_COMMON_VIDEO_PREVIEW_HEIGHT, VIDEO_FORMAT_RGB24);
 		videoq_frame frm;
 		frm.data = tmp_frame_preview->data[0];
-		BOOL result = session->video_shm_q_preview->GetVideo(&frm, iflags);
+		bool result = session->video_shm_q_preview->GetVideo(&frm, iflags);
 		//人形框融合处理
 		if (result&&session->personimage!=NULL&&session->personmask!=NULL&&*session->conf.ref_Is_showPersonArea==1)
 		{		
@@ -510,7 +510,7 @@ static int on_pull(videoplayer_t *player, void *user_data, video_frame **frame)
 			{
 				char strPath[MAX_PATH] = {0};
 				GetCurrentRunPath(strPath);
-				sprintf(strPath, "%s\\bin\\looklowerscreen.jpg", strPath);
+				_snprintf(strPath, MAX_PATH, "%s\\bin\\looklowerscreen.jpg", strPath);
 				if (_access(strPath,0)!=-1)
 				{
 					IplImage*img = cvLoadImage(strPath,1);
@@ -553,7 +553,7 @@ static int on_pull(videoplayer_t *player, void *user_data, video_frame **frame)
 					videoq_frame frm;
 					int offset = (REC_COMMON_VIDEO_SNAPSHOT_WIDTH - REC_COMMON_VIDEO_SNAPSHOT_HEIGHT) / 2;
 					frm.data = tmp_frame_preview->data[0] + offset * tmp_frame_preview->linesize[0];
-					if (FALSE == session->video_shm_q_env->GetVideo(&frm, VIDEOQUEUE_FLAG_VERTICAL_FLIP)){
+					if (false == session->video_shm_q_env->GetVideo(&frm, VIDEOQUEUE_FLAG_VERTICAL_FLIP)){
 						session->bcamera_error_posted = true;
 					}	
 				}
@@ -569,7 +569,7 @@ static int on_pull(videoplayer_t *player, void *user_data, video_frame **frame)
 					tt.linesize[0] = tmp_frame_preview->linesize[0];
 					tt.width = REC_COMMON_VIDEO_SNAPSHOT_HEIGHT;
 					tt.height = REC_COMMON_VIDEO_SNAPSHOT_WIDTH;
-					if (FALSE == session->video_shm_q_opt->GetVideo2(&tt, VIDEOQUEUE_FLAG_VERTICAL_FLIP)){
+					if (false == session->video_shm_q_opt->GetVideo2(&tt, VIDEOQUEUE_FLAG_VERTICAL_FLIP)){
 						if (__camera_error_event(session->bcamera_error_posted, 1)){
 							session->bcamera_error_posted = true;
 						}
@@ -582,7 +582,7 @@ static int on_pull(videoplayer_t *player, void *user_data, video_frame **frame)
 			tmp_frame_preview = video_frame_new(REC_COMMON_VIDEO_PREVIEW_WIDTH, REC_COMMON_VIDEO_PREVIEW_HEIGHT, VIDEO_FORMAT_RGB24);
 			videoq_frame frm;
 			frm.data = tmp_frame_preview->data[0];
-			BOOL result = session->video_shm_q_preview->GetVideo(&frm, iflags);
+			bool result = session->video_shm_q_preview->GetVideo(&frm, iflags);
 			//人形框融合处理
 			if (result&&session->personimage!=NULL&&session->personmask!=NULL&&*session->conf.ref_Is_showPersonArea==1)
 			{		
@@ -662,7 +662,7 @@ static int get_local_video_frame(void* user_data, video_frame** frame)
 		tmp_frame_preview = video_frame_new(REC_COMMON_VIDEO_PREVIEW_WIDTH, REC_COMMON_VIDEO_PREVIEW_HEIGHT, VIDEO_FORMAT_RGB24);
 		videoq_frame frm;
 		frm.data = tmp_frame_preview->data[0];
-		BOOL result = session->video_shm_q_preview->GetVideo(&frm, VIDEOQUEUE_FLAG_HORIZONTAL_FLIP);
+		bool result = session->video_shm_q_preview->GetVideo(&frm, VIDEOQUEUE_FLAG_HORIZONTAL_FLIP);
 		//人形框融合处理
 		if (result){
 			if (session->personimage != NULL && session->personmask != NULL && *session->conf.ref_Is_showPersonArea == 1)
@@ -763,7 +763,7 @@ static int get_local_video_frame(void* user_data, video_frame** frame)
 			tmp_frame_preview = video_frame_new(REC_COMMON_VIDEO_PREVIEW_WIDTH, REC_COMMON_VIDEO_PREVIEW_HEIGHT, VIDEO_FORMAT_RGB24);
 			videoq_frame frm;
 			frm.data = tmp_frame_preview->data[0];
-			BOOL result = session->video_shm_q_preview->GetVideo(&frm, VIDEOQUEUE_FLAG_HORIZONTAL_FLIP);
+			bool result = session->video_shm_q_preview->GetVideo(&frm, VIDEOQUEUE_FLAG_HORIZONTAL_FLIP);
 			if (result){
 				//人形框融合处理
 				if (session->personimage != NULL && session->personmask != NULL && *session->conf.ref_Is_showPersonArea == 1)
@@ -930,7 +930,7 @@ static void	show_remote_agnet_picture(video_session_t *t_session)
 	}
 
 	GetCurrentRunPath(strPath);
-	sprintf(strImgPath,"%s\\bin\\agent.jpg",strPath);
+	_snprintf(strImgPath, MAX_PATH, "%s\\bin\\agent.jpg", strPath);
 
 	video_frame* remote_frame = video_frame_new(irecord_video_frame_width, irecord_video_frame_heigt, VIDEO_FORMAT_RGB24);
 	video_frame_fill_black(remote_frame);
@@ -1132,17 +1132,17 @@ static int start_video(video_session_t *session)
 			}
 		}
 
-		BOOL bIsActiveInspect = FALSE;
+		bool bIsActiveInspect = false;
 		if (session->conf.ref_Is_ActiveInspect != NULL){
 			if (*session->conf.ref_Is_ActiveInspect == 1){
-				bIsActiveInspect = TRUE;
+				bIsActiveInspect = true;
 			} 
 			else{
-				bIsActiveInspect = FALSE;
+				bIsActiveInspect = false;
 			}
 		}
 		else{
-			bIsActiveInspect = FALSE;
+			bIsActiveInspect = false;
 		}
 
 		if (DOUBLERECORD_CALLTYPE != session->conf.nCallType){

+ 3 - 3
Other/unix/libvideoframework/videoplayer.c

@@ -372,7 +372,7 @@ static void OnMsgTimer_PushMode(videoplayer_t *player, HWND hWnd, UINT msg, WPAR
 			}
 		}
 	} else {
-		int displayed = 0;
+		bool bdisplayed = false;
 		//if (player->q_head == player->q_tail)
 		while (player->q_tail != player->q_head) {
 			frame_entry *entry = &player->frames[player->q_head];
@@ -383,7 +383,7 @@ static void OnMsgTimer_PushMode(videoplayer_t *player, HWND hWnd, UINT msg, WPAR
 			} else {
 				//Dbg("display frame");
 				display_frame_entry(player, entry->raw_frame);
-				displayed = TRUE;
+				bdisplayed = true;
 				free_frame_entry(player, &player->current_frame);
 				player->current_frame.raw_frame = entry->raw_frame;
 				player->current_frame.free_frame = entry->free_frame;
@@ -393,7 +393,7 @@ static void OnMsgTimer_PushMode(videoplayer_t *player, HWND hWnd, UINT msg, WPAR
 				break;
 			}
 		}
-		if (!displayed) {
+		if (!bdisplayed) {
 			player->q_caching = TRUE;
 			Dbg("recaching");
 		}