]> git.sesse.net Git - vlc/blobdiff - modules/misc/lua/meta.c
lua_meta: factorize.
[vlc] / modules / misc / lua / meta.c
index 01f262097b3ae60888eef8f6185c64c26337ccfb..650fb0d98db1dd76651624949dc987346f1834cd 100644 (file)
@@ -35,7 +35,6 @@
 
 #include <vlc_common.h>
 #include <vlc_input.h>
-#include <vlc_playlist.h>
 #include <vlc_meta.h>
 #include <vlc_demux.h>
 #include <vlc_art_finder.h>
@@ -181,7 +180,7 @@ static int fetch_art( vlc_object_t *p_this, const char * psz_filename,
 }
 
 /*****************************************************************************
- * Called through lua_scripts_batch_execute to call 'fetch_art' on the script
+ * Called through lua_scripts_batch_execute to call 'read_meta' on the script
  * pointed by psz_filename.
  *****************************************************************************/
 static int read_meta( vlc_object_t *p_this, const char * psz_filename,
@@ -193,15 +192,10 @@ static int read_meta( vlc_object_t *p_this, const char * psz_filename,
         return VLC_EGENERIC;
 
     int i_ret = run(p_this, psz_filename, L, "read_meta");
-    if(i_ret != VLC_SUCCESS)
-    {
-        lua_close( L );
-        return i_ret;
-    }
-
-    // Continue, all "meta reader" are always run.
     lua_close( L );
-    return 1;
+
+    // Continue even if an error occured: all "meta reader" are always run.
+    return i_ret == VLC_SUCCESS ? VLC_EGENERIC : i_ret;
 }