diff --git a/coreapi/linphonecall.c b/coreapi/linphonecall.c index 74542d35b..90f3a9866 100644 --- a/coreapi/linphonecall.c +++ b/coreapi/linphonecall.c @@ -1664,15 +1664,15 @@ void linphone_call_enable_camera (LinphoneCall *call, bool_t enable){ #ifdef VIDEO_ENABLED call->camera_enabled=enable; if ((call->state==LinphoneCallStreamsRunning || call->state==LinphoneCallOutgoingEarlyMedia || call->state==LinphoneCallIncomingEarlyMedia) - && call->videostream!=NULL ){ + && call->videostream!=NULL && video_stream_started(call->videostream) ){ if (video_stream_get_camera(call->videostream) != linphone_call_get_video_device(call)) { - ms_message("Swithching video cam from [%s] to %s on call [%p]" ,ms_web_cam_get_name(video_stream_get_camera(call->videostream)) - ,ms_web_cam_get_name(linphone_call_get_video_device(call)) - ,call); - video_stream_change_camera(call->videostream,linphone_call_get_video_device(call)); + const char *cur_cam, *new_cam; + cur_cam = video_stream_get_camera(call->videostream) ? ms_web_cam_get_name(video_stream_get_camera(call->videostream)) : "NULL"; + new_cam = linphone_call_get_video_device(call) ? ms_web_cam_get_name(linphone_call_get_video_device(call)) : "NULL"; + ms_message("Switching video cam from [%s] to [%s] on call [%p]" , cur_cam, new_cam, call); + video_stream_change_camera(call->videostream, linphone_call_get_video_device(call)); } } - #endif } diff --git a/tester/tester.c b/tester/tester.c index daec6509f..80cddbf40 100644 --- a/tester/tester.c +++ b/tester/tester.c @@ -273,7 +273,7 @@ LinphoneCoreManager* linphone_core_manager_init(const char* rc_file) { if (cam == NULL) { cam=ms_web_cam_new(&mire_desc); - ms_web_cam_manager_add_cam(ms_web_cam_manager_get(),cam); + ms_web_cam_manager_add_cam(ms_web_cam_manager_get(), cam); } } #endif