Commit 71f81ce6 authored by jehan's avatar jehan
Browse files

improve rtcp checking speed

parent 1b47a0df
......@@ -103,14 +103,15 @@ static void check_rtcp(LinphoneCoreManager* caller, LinphoneCoreManager* callee)
c1=linphone_core_get_current_call(caller->lc);
c2=linphone_core_get_current_call(callee->lc);
for (i=0; i<3; i++) {
for (i=0; i<12 /*=6s*/; i++) {
if (linphone_call_get_audio_stats(c1)->round_trip_delay >0.0
&& linphone_call_get_audio_stats(c2)->round_trip_delay >0.0
&& (!linphone_call_get_video_stats(c1) || linphone_call_get_video_stats(c1)->round_trip_delay>0.0)
&& (!linphone_call_get_video_stats(c1) || linphone_call_get_video_stats(c1)->round_trip_delay>0.0)) {
&& (!linphone_call_log_video_enabled(linphone_call_get_call_log(c1)) || linphone_call_get_video_stats(c1)->round_trip_delay>0.0)
&& (!linphone_call_log_video_enabled(linphone_call_get_call_log(c2)) || linphone_call_get_video_stats(c2)->round_trip_delay>0.0)) {
break;
}
wait_for(caller->lc,callee->lc,&dummy,1);
wait_for_until(caller->lc,callee->lc,&dummy,1,500); /*just to sleep while iterating*/
}
CU_ASSERT_TRUE(linphone_call_get_audio_stats(c1)->round_trip_delay>0.0);
......
......@@ -125,18 +125,21 @@ static LinphoneCore* configure_lc_from(LinphoneCoreVTable* v_table, const char*
return lc;
}
bool_t wait_for(LinphoneCore* lc_1, LinphoneCore* lc_2,int* counter,int value) {
bool_t wait_for_until(LinphoneCore* lc_1, LinphoneCore* lc_2,int* counter,int value,int timout) {
MSList* lcs=NULL;
bool_t result;
if (lc_1)
lcs=ms_list_append(lcs,lc_1);
if (lc_2)
lcs=ms_list_append(lcs,lc_2);
result=wait_for_list(lcs,counter,value,2000);
result=wait_for_list(lcs,counter,value,timout);
ms_list_free(lcs);
return result;
}
bool_t wait_for(LinphoneCore* lc_1, LinphoneCore* lc_2,int* counter,int value) {
return wait_for_until(lc_1, lc_2,counter,value,2000);
}
bool_t wait_for_list(MSList* lcs,int* counter,int value,int timeout_ms) {
int retry=0;
MSList* iterator;
......
......@@ -203,6 +203,7 @@ void linphone_notify_received(LinphoneCore *lc, LinphoneEvent *lev, const char *
LinphoneAddress * create_linphone_address(const char * domain);
bool_t wait_for(LinphoneCore* lc_1, LinphoneCore* lc_2,int* counter,int value);
bool_t wait_for_list(MSList* lcs,int* counter,int value,int timeout_ms);
bool_t wait_for_until(LinphoneCore* lc_1, LinphoneCore* lc_2,int* counter,int value,int timout_ms);
bool_t call(LinphoneCoreManager* caller_mgr,LinphoneCoreManager* callee_mgr);
stats * get_stats(LinphoneCore *lc);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment