From 26872b930df4c7605549c6c21d5e25d8b0d0a6a5 Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Tue, 13 Jun 2017 14:31:08 +0200 Subject: [PATCH] Fix linphone_factory_get_ring_resources_dir() that did not return the correct path if the sound_resources_dir has not been set. --- coreapi/factory.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/coreapi/factory.c b/coreapi/factory.c index 5601a620b..27e30e984 100644 --- a/coreapi/factory.c +++ b/coreapi/factory.c @@ -264,8 +264,12 @@ void linphone_factory_set_sound_resources_dir(LinphoneFactory *factory, const ch const char * linphone_factory_get_ring_resources_dir(LinphoneFactory *factory) { if (factory->ring_resources_dir) return factory->ring_resources_dir; if (factory->sound_resources_dir){ - STRING_TRANSFER(factory->cached_sound_resources_dir, bctbx_strdup_printf("%s/rings", factory->sound_resources_dir)); - return factory->cached_sound_resources_dir; + STRING_TRANSFER(factory->cached_ring_resources_dir, bctbx_strdup_printf("%s/rings", factory->sound_resources_dir)); + return factory->cached_ring_resources_dir; + } + if (factory->top_resources_dir) { + STRING_TRANSFER(factory->cached_ring_resources_dir, bctbx_strdup_printf("%s/sounds/linphone/rings", factory->top_resources_dir)); + return factory->cached_ring_resources_dir; } return PACKAGE_RING_DIR; }