]> git.sesse.net Git - vlc/blobdiff - modules/lua/vlc.c
avcommon: Move the libavutil check where it belongs
[vlc] / modules / lua / vlc.c
index 1da88ced8c169228d0d11d93c6683cd21ca83b94..6f9b50528db293c636fa55e534fa4231899a8a8d 100644 (file)
@@ -109,7 +109,7 @@ vlc_module_begin ()
         set_capability( "interface", 25 )
         set_description( N_("Command-line interface") )
         set_callbacks( Open_LuaCLI, Close_LuaIntf )
-#ifndef WIN32
+#ifndef _WIN32
         add_shortcut( "luacli", "luarc", "cli", "rc" )
 #else
         add_shortcut( "luacli", "luarc" )
@@ -215,7 +215,7 @@ int vlclua_dir_list( const char *luadirname, char ***pppsz_dir_list )
         i++;
     free( datadir );
 
-#if !(defined(__APPLE__) || defined(WIN32) || defined(__OS2__))
+#if !(defined(__APPLE__) || defined(_WIN32) || defined(__OS2__))
     char *psz_libpath = config_GetLibDir();
     if( likely(psz_libpath != NULL) )
     {
@@ -496,8 +496,10 @@ int vlclua_playlist_add_internal( vlc_object_t *p_this, lua_State *L,
                     input_item_t *p_input;
 
                     /* Read path and name */
-                    psz_oldurl = input_item_GetURI( p_parent );
-                    msg_Dbg( p_this, "old path: %s", psz_oldurl );
+                    if (p_parent) {
+                        psz_oldurl = input_item_GetURI( p_parent );
+                        msg_Dbg( p_this, "old path: %s", psz_oldurl );
+                    }
                     psz_path = lua_tostring( L, -1 );
                     msg_Dbg( p_this, "Path: %s", psz_path );
                     lua_getfield( L, -2, "name" );
@@ -547,14 +549,14 @@ int vlclua_playlist_add_internal( vlc_object_t *p_this, lua_State *L,
 
                     /* copy the original URL to the meta data, if "URL" is still empty */
                     char* url = input_item_GetURL( p_input );
-                    if( url == NULL )
+                    if( url == NULL && p_parent)
                     {
                         EnsureUTF8( psz_oldurl );
                         msg_Dbg( p_this, "meta-URL: %s", psz_oldurl );
                         input_item_SetURL ( p_input, psz_oldurl );
                     }
-                    free( url );
                     free( psz_oldurl );
+                    free( url );
 
                     /* copy the psz_name to the meta data, if "Title" is still empty */
                     char* title = input_item_GetTitle( p_input );