mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-17 19:18:06 +00:00
Fix bug when setting up custom tone twice.
This commit is contained in:
parent
f37e3f5345
commit
bcae09e42e
2 changed files with 22 additions and 2 deletions
|
|
@ -1372,7 +1372,7 @@ const char *linphone_core_get_tone_file(const LinphoneCore *lc, LinphoneToneID i
|
|||
}
|
||||
|
||||
void _linphone_core_set_tone(LinphoneCore *lc, LinphoneReason reason, LinphoneToneID id, const char *audiofile){
|
||||
LinphoneToneDescription *tone=linphone_core_get_call_error_tone(lc,reason);
|
||||
LinphoneToneDescription *tone = linphone_core_lookup_tone(lc,reason, id);
|
||||
if (tone){
|
||||
lc->tones=bctbx_list_remove(lc->tones,tone);
|
||||
linphone_tone_description_destroy(tone);
|
||||
|
|
|
|||
|
|
@ -383,6 +383,25 @@ static void codec_setup(void){
|
|||
|
||||
}
|
||||
|
||||
static void custom_tones_setup(void){
|
||||
LinphoneCoreManager *mgr = linphone_core_manager_new2("empty_rc", FALSE);
|
||||
const char *tone;
|
||||
|
||||
linphone_core_set_tone(mgr->lc, LinphoneToneCallOnHold, "callonhold.wav");
|
||||
tone = linphone_core_get_tone_file(mgr->lc, LinphoneToneCallOnHold);
|
||||
BC_ASSERT_PTR_NOT_NULL(tone);
|
||||
if (tone){
|
||||
BC_ASSERT_STRING_EQUAL(tone, "callonhold.wav");
|
||||
}
|
||||
linphone_core_set_tone(mgr->lc, LinphoneToneCallOnHold, "callonhold2.wav");
|
||||
tone = linphone_core_get_tone_file(mgr->lc, LinphoneToneCallOnHold);
|
||||
BC_ASSERT_PTR_NOT_NULL(tone);
|
||||
if (tone){
|
||||
BC_ASSERT_STRING_EQUAL(tone, "callonhold2.wav");
|
||||
}
|
||||
linphone_core_manager_destroy(mgr);
|
||||
}
|
||||
|
||||
test_t setup_tests[] = {
|
||||
TEST_NO_TAG("Version check", linphone_version_test),
|
||||
TEST_NO_TAG("Linphone Address", linphone_address_test),
|
||||
|
|
@ -398,7 +417,8 @@ test_t setup_tests[] = {
|
|||
TEST_NO_TAG("Chat room", chat_room_test),
|
||||
TEST_NO_TAG("Devices reload", devices_reload_test),
|
||||
TEST_NO_TAG("Codec usability", codec_usability_test),
|
||||
TEST_NO_TAG("Codec setup", codec_setup)
|
||||
TEST_NO_TAG("Codec setup", codec_setup),
|
||||
TEST_NO_TAG("Custom tones setup", custom_tones_setup)
|
||||
};
|
||||
|
||||
test_suite_t setup_test_suite = {"Setup", NULL, NULL, liblinphone_tester_before_each, liblinphone_tester_after_each,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue