X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fcontrol%2Fmedia.c;h=bdb0ce310dbd186480205cec848f03da8409e954;hb=7eccf3a2cf7bdf158f58b8f4ef006ad604738c0b;hp=0b6147ef0680cc8f07598530c70dd54d41585072;hpb=501f845fee66daa613d83f460a35626399fdccc9;p=vlc diff --git a/src/control/media.c b/src/control/media.c index 0b6147ef06..bdb0ce310d 100644 --- a/src/control/media.c +++ b/src/control/media.c @@ -36,6 +36,7 @@ #include #include #include /* For the preparser */ +#include #include "libvlc.h" @@ -294,8 +295,8 @@ libvlc_media_t * libvlc_media_new_from_input_item( /************************************************************************** * Create a new media descriptor object **************************************************************************/ -libvlc_media_t * libvlc_media_new( libvlc_instance_t *p_instance, - const char * psz_mrl ) +libvlc_media_t *libvlc_media_new_location( libvlc_instance_t *p_instance, + const char * psz_mrl ) { input_item_t * p_input_item; libvlc_media_t * p_md; @@ -316,6 +317,21 @@ libvlc_media_t * libvlc_media_new( libvlc_instance_t *p_instance, return p_md; } +libvlc_media_t *libvlc_media_new_path( libvlc_instance_t *p_instance, + const char *path ) +{ + char *mrl = make_URI( path ); + if( unlikely(mrl == NULL) ) + { + libvlc_printerr( "Not enough memory" ); + return NULL; + } + + libvlc_media_t *m = libvlc_media_new_location( p_instance, mrl ); + free( mrl ); + return m; +} + /************************************************************************** * Create a new media descriptor object **************************************************************************/