]> git.sesse.net Git - vlc/blobdiff - src/playlist/loadsave.c
Replace CONFIG_HINT and CONFIG_ITEM with a boolean macro
[vlc] / src / playlist / loadsave.c
index ce9f9d13a68911f97db67f6051bb6a57da29f6a7..97d75a197d2f9a6b0aa3ede9c72d41ba42196063 100644 (file)
@@ -31,6 +31,7 @@
 #include "config/configuration.h"
 #include <vlc_fs.h>
 #include <vlc_url.h>
+#include <vlc_modules.h>
 
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -47,7 +48,6 @@ int playlist_Export( playlist_t * p_playlist, const char *psz_filename,
     if( !p_export )
         return VLC_ENOMEM;
 
-    vlc_object_attach( p_export, p_playlist );
     msg_Dbg( p_export, "saving %s to file %s",
              p_export_root->p_input->psz_name, psz_filename );
 
@@ -128,7 +128,7 @@ int playlist_MLLoad( playlist_t *p_playlist )
     }
 
     char *psz_file;
-    if( asprintf( &psz_file, "%s" DIR_SEP "ml.xspf", psz_datadir ) != -1 )
+    if( asprintf( &psz_file, "%s" DIR_SEP "ml.xspf", psz_datadir ) == -1 )
         psz_file = NULL;
     free( psz_datadir );
     if( psz_file == NULL )
@@ -136,10 +136,11 @@ int playlist_MLLoad( playlist_t *p_playlist )
 
     /* loosy check for media library file */
     struct stat st;
-    int ret = vlc_stat( psz_file, &st );
-    free( psz_file );
-    if( ret )
+    if( vlc_stat( psz_file, &st ) )
+    {
+        free( psz_file );
         return VLC_EGENERIC;
+    }
 
     char *psz_uri = make_URI( psz_file, "file/xspf-open" );
     free( psz_file );