Fix linphone_factory_get_ring_resources_dir() that did not return the correct path if the sound_resources_dir has not been set.

This commit is contained in:
Ghislain MARY 2017-06-13 14:31:08 +02:00
parent 2aa9087b70
commit 26872b930d

View file

@ -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;
}