]> git.sesse.net Git - vlc/blobdiff - modules/misc/lua/vlc.c
cdda: Fix issue with pausing of CDDA
[vlc] / modules / misc / lua / vlc.c
index ad5c0b568c989175aea6952601cbc6089e5ea89e..dcf87b12f5618039161c3f2e02851e322f1388a2 100644 (file)
@@ -143,6 +143,13 @@ int vlclua_dir_list( const char *luadirname, char **ppsz_dir_list )
     return VLC_SUCCESS;
 }
 
+void vlclua_dir_list_free( char **ppsz_dir_list )
+{
+    char **ppsz_dir;
+    for( ppsz_dir = ppsz_dir_list; *ppsz_dir; ppsz_dir++ )
+        free( *ppsz_dir );
+}
+
 /*****************************************************************************
  * Will execute func on all scripts in luadirname, and stop if func returns
  * success.
@@ -192,7 +199,10 @@ int vlclua_scripts_batch_execute( vlc_object_t *p_this,
             char  *psz_filename;
             if( asprintf( &psz_filename,
                           "%s" DIR_SEP "%s", *ppsz_dir, *ppsz_file ) < 0)
+            {
+                vlclua_dir_list_free( ppsz_dir_list );
                 return VLC_ENOMEM;
+            }
             msg_Dbg( p_this, "Trying Lua playlist script %s", psz_filename );
 
             i_ret = func( p_this, psz_filename, L, user_data );
@@ -211,8 +221,7 @@ int vlclua_scripts_batch_execute( vlc_object_t *p_this,
             free( *ppsz_file );
         free( ppsz_filelist );
     }
-    for( ppsz_dir = ppsz_dir_list; *ppsz_dir; ppsz_dir++ )
-        free( *ppsz_dir );
+    vlclua_dir_list_free( ppsz_dir_list );
 
     return i_ret;
 }
@@ -307,7 +316,7 @@ void __vlclua_read_custom_meta_data( vlc_object_t *p_this, lua_State *L,
                         msg_Dbg( p_this, "Custom meta %s, %s: %s",
                                  psz_meta_category, psz_meta_name,
                                  psz_meta_value );
-                        input_ItemAddInfo( p_input, psz_meta_category,
+                        input_item_AddInfo( p_input, psz_meta_category,
                                            psz_meta_name, psz_meta_value );
                     }
                     lua_pop( L, 1 ); /* pop item */
@@ -424,7 +433,7 @@ int __vlclua_playlist_add_internal( vlc_object_t *p_this, lua_State *L,
                     vlclua_read_options( p_this, L, &i_options, &ppsz_options );
 
                     /* Create input item */
-                    p_input = input_ItemNewExt( p_playlist, psz_path,
+                    p_input = input_item_NewExt( p_playlist, psz_path,
                                                 psz_name, i_options,
                                                 (const char **)ppsz_options,
                                                 i_duration );
@@ -439,7 +448,7 @@ int __vlclua_playlist_add_internal( vlc_object_t *p_this, lua_State *L,
 
                     /* Append item to playlist */
                     if( p_parent ) /* Add to node */
-                        input_ItemAddSubItem( p_parent, p_input );
+                        input_item_AddSubItem( p_parent, p_input );
                     else /* Play or Enqueue (preparse) */
                         /* FIXME: playlist_AddInput() can fail */
                         playlist_AddInput( p_playlist, p_input,