From c3711b81c922eb0e4529201d70f55300eab2973a Mon Sep 17 00:00:00 2001 From: William King Date: Wed, 22 Jan 2014 13:55:13 -0800 Subject: [PATCH] If libvlc fails to initialize, then the module should fail to load. --- src/mod/formats/mod_vlc/mod_vlc.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/mod/formats/mod_vlc/mod_vlc.c b/src/mod/formats/mod_vlc/mod_vlc.c index fe0aeb71f0..3238c884e5 100644 --- a/src/mod/formats/mod_vlc/mod_vlc.c +++ b/src/mod/formats/mod_vlc/mod_vlc.c @@ -398,6 +398,11 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_vlc_load) /* load the vlc engine. */ read_inst = libvlc_new(1, &vlc_args); + if ( ! read_inst ) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "FAILED TO LOAD\n"); + return SWITCH_STATUS_GENERR; + } + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Initialized VLC instance\n"); /* indicate that the module should continue to be loaded */