From 697a6d4a89c22241a19d23359ac6ac786d7caeb9 Mon Sep 17 00:00:00 2001 From: Guillaume BIENKOWSKI Date: Mon, 15 Dec 2014 14:49:42 +0100 Subject: [PATCH] Fix the soundcard hint so that it trigger only when _all_ calls are paused or pausing (instead of just one call suffice). Also increase the test delay. --- coreapi/linphonecore.c | 8 ++++---- tester/call_tester.c | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 694ad2695..9798e4636 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -6438,20 +6438,20 @@ static void notify_soundcard_usage(LinphoneCore *lc, bool_t used){ void linphone_core_soundcard_hint_check( LinphoneCore* lc){ MSList* the_calls = lc->calls; LinphoneCall* call = NULL; - bool_t remaining_paused = FALSE; + bool_t dont_need_sound = TRUE; /* check if the remaining calls are paused */ while( the_calls ){ call = the_calls->data; - if( call->state == LinphoneCallPausing || call->state == LinphoneCallPaused ){ - remaining_paused = TRUE; + if( call->state != LinphoneCallPausing && call->state != LinphoneCallPaused ){ + dont_need_sound = FALSE; break; } the_calls = the_calls->next; } /* if no more calls or all calls are paused, we can free the soundcard */ - if ( (lc->calls==NULL || remaining_paused) && !lc->use_files){ + if ( (lc->calls==NULL || dont_need_sound) && !lc->use_files){ ms_message("Notifying soundcard that we don't need it anymore for calls."); notify_soundcard_usage(lc,FALSE); } diff --git a/tester/call_tester.c b/tester/call_tester.c index df3b8636b..426282097 100644 --- a/tester/call_tester.c +++ b/tester/call_tester.c @@ -2581,8 +2581,8 @@ static void call_transfer_existing_call_outgoing_call(void) { CU_ASSERT_TRUE(wait_for_list(lcs,&pauline->stat.number_of_LinphoneCallRefered,1,2000)); /*pauline pausing marie*/ - CU_ASSERT_TRUE(wait_for_list(lcs,&pauline->stat.number_of_LinphoneCallPausing,1,2000)); - CU_ASSERT_TRUE(wait_for_list(lcs,&pauline->stat.number_of_LinphoneCallPaused,1,2000)); + CU_ASSERT_TRUE(wait_for_list(lcs,&pauline->stat.number_of_LinphoneCallPausing,1,4000)); + CU_ASSERT_TRUE(wait_for_list(lcs,&pauline->stat.number_of_LinphoneCallPaused,1,4000)); /*pauline calling laure*/ CU_ASSERT_TRUE(wait_for_list(lcs,&pauline->stat.number_of_LinphoneCallOutgoingProgress,1,2000)); CU_ASSERT_TRUE(wait_for_list(lcs,&marie->stat.number_of_LinphoneTransferCallOutgoingInit,1,2000));