Commit 92ebfe8b authored by Rafaël Carré's avatar Rafaël Carré

Checks if ml.xsp is present before loading it

parent 8e081cf1
......@@ -26,6 +26,9 @@
#include "modules/configuration.h"
#include <vlc_charset.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <errno.h>
int playlist_Export( playlist_t * p_playlist, const char *psz_filename ,
......@@ -97,6 +100,21 @@ int playlist_MLLoad( playlist_t *p_playlist )
return VLC_EGENERIC;
}
if( asprintf( &psz_uri, "%s" DIR_SEP CONFIG_DIR DIR_SEP
"ml.xsp", psz_homedir ) == -1 )
{
psz_uri = NULL;
goto error;
}
struct stat p_stat;
/* checks if media library file is present */
if( utf8_stat( psz_uri , &p_stat ) )
{
free( psz_uri );
return VLC_EGENERIC;
}
free( psz_uri );
if( asprintf( &psz_uri, "file/xspf-open://%s" DIR_SEP CONFIG_DIR DIR_SEP
"ml.xsp", psz_homedir ) == -1 )
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment