From: William King Date: Thu, 26 Apr 2012 16:05:56 +0000 (-0700) Subject: Confirm we can open the file successfully before trying to add it to a libvlc media... X-Git-Tag: v1.2-rc1~17^2~126 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=37e726b7e79c3528d2a3ac10ce1aa848b5946acc;p=thirdparty%2Ffreeswitch.git Confirm we can open the file successfully before trying to add it to a libvlc media player --- diff --git a/src/mod/formats/mod_vlc/mod_vlc.c b/src/mod/formats/mod_vlc/mod_vlc.c index 98a40f77ad..b19abd81dc 100644 --- a/src/mod/formats/mod_vlc/mod_vlc.c +++ b/src/mod/formats/mod_vlc/mod_vlc.c @@ -123,6 +123,11 @@ static switch_status_t vlc_file_open(switch_file_handle_t *handle, const char *p context->m = libvlc_media_new_location(read_inst, context->path); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "VLC Path is unknown type %s\n", context->path); } + + if ( context-m == NULL ) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "VLC error opening %s for reading\n", path); + return SWITCH_STATUS_GENERR; + } context->playing = 0; context->err = 0;