summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main/sounds_index.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/main/sounds_index.c b/main/sounds_index.c
index bc5263908..8ca5967e4 100644
--- a/main/sounds_index.c
+++ b/main/sounds_index.c
@@ -302,17 +302,21 @@ int ast_sounds_index_init(void)
return -1;
}
- res |= stasis_message_router_add(
- sounds_system_router,
- ast_format_register_type(),
- format_update_cb,
- NULL);
-
- res |= stasis_message_router_add(
- sounds_system_router,
- ast_format_unregister_type(),
- format_update_cb,
- NULL);
+ if (ast_format_register_type()) {
+ res |= stasis_message_router_add(
+ sounds_system_router,
+ ast_format_register_type(),
+ format_update_cb,
+ NULL);
+ }
+
+ if (ast_format_unregister_type()) {
+ res |= stasis_message_router_add(
+ sounds_system_router,
+ ast_format_unregister_type(),
+ format_update_cb,
+ NULL);
+ }
if (res) {
return -1;