From 71f81ce6ecc0b3775b82f4beb9efd0bdfa737f13 Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Tue, 24 Sep 2013 16:28:50 +0200 Subject: [PATCH] improve rtcp checking speed --- tester/call_tester.c | 9 +++++---- tester/liblinphone_tester.c | 9 ++++++--- tester/liblinphone_tester.h | 1 + 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/tester/call_tester.c b/tester/call_tester.c index 18f7a2ec9..fcffbcc56 100644 --- a/tester/call_tester.c +++ b/tester/call_tester.c @@ -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); diff --git a/tester/liblinphone_tester.c b/tester/liblinphone_tester.c index a1115c8ce..2e4cd678e 100644 --- a/tester/liblinphone_tester.c +++ b/tester/liblinphone_tester.c @@ -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; diff --git a/tester/liblinphone_tester.h b/tester/liblinphone_tester.h index f9c58d725..ae5143671 100644 --- a/tester/liblinphone_tester.h +++ b/tester/liblinphone_tester.h @@ -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);