]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[mod_vlc] Fix segfault.
authorPiotr Gregor <piotr@dataandsignal.com>
Fri, 5 Apr 2019 16:04:27 +0000 (16:04 +0000)
committerAndrey Volk <andywolk@gmail.com>
Wed, 6 May 2020 22:33:51 +0000 (02:33 +0400)
src/mod/formats/mod_vlc/mod_vlc.c

index aa6d8d36fc0fb5f9b33cefdf19f6d0d5a5dfefda..af83330d07da525bee33d0cb3659bb592094a185 100644 (file)
@@ -62,7 +62,7 @@ typedef int  (*imem_get_t)(void *data, const char *cookie,
 typedef void (*imem_release_t)(void *data, const char *cookie, size_t, void *);
 
 /* Change value to -vvv for vlc related debug. Be careful since vlc is at least as verbose as FS about logging */
-const char *vlc_args[] = {"-v"};
+const char *vlc_args[] = {"-vvv"};
 //const char *vlc_args[] = {"--network-caching=0"};
 //--sout-mux-caching
 
@@ -768,6 +768,10 @@ static switch_status_t vlc_file_open(switch_file_handle_t *handle, const char *p
        context = switch_core_alloc(handle->memory_pool, sizeof(*context));
        context->pool = handle->memory_pool;
        context->vlc_handle = libvlc_new(sizeof(vlc_args)/sizeof(char *), vlc_args);
+    if (!context->vlc_handle) {
+        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "VLC error: cannot initialise VLC handle\n");
+        return SWITCH_STATUS_GENERR;
+    }
        libvlc_log_set(context->vlc_handle, log_cb, NULL);
 
        realpath = path;