[vlc-devel] commit: tmp (Pierre d'Herbemont )

git version control git at videolan.org
Wed Jan 6 16:50:34 CET 2010


vlc | branch: master | Pierre d'Herbemont <pdherbemont at free.fr> | Wed Jan  6 16:38:32 2010 +0100| [de56dfd5390f69d9a9ab2a431bb055463eb749a7] | committer: Pierre d'Herbemont 

tmp

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=de56dfd5390f69d9a9ab2a431bb055463eb749a7
---

 modules/misc/lua/Modules.am |    1 +
 modules/misc/lua/vlc.c      |    6 ++++++
 modules/misc/lua/vlc.h      |    2 ++
 share/Makefile.am           |    1 +
 src/playlist/fetcher.c      |   31 ++++++++++++++++++++++++++++++-
 5 files changed, 40 insertions(+), 1 deletions(-)

diff --git a/modules/misc/lua/Modules.am b/modules/misc/lua/Modules.am
index 22aa829..1f698fc 100644
--- a/modules/misc/lua/Modules.am
+++ b/modules/misc/lua/Modules.am
@@ -1,6 +1,7 @@
 SOURCES_lua = \
 	intf.c \
 	meta.c \
+	decrapifier.c \
 	demux.c \
 	vlc.c \
 	vlc.h \
diff --git a/modules/misc/lua/vlc.c b/modules/misc/lua/vlc.c
index 275fcc0..4fce984 100644
--- a/modules/misc/lua/vlc.c
+++ b/modules/misc/lua/vlc.c
@@ -64,6 +64,12 @@ vlc_module_begin ()
         set_callbacks( FindArt, NULL )
 
     add_submodule ()
+        set_shortname( N_( "Lua Decrapifier" ) )
+        set_description( N_("Remove crappy part of the movie name") )
+        set_capability( "movie name decrapifier", 10 )
+        set_callbacks( Decrapify, NULL )
+
+    add_submodule ()
         add_shortcut( "luaplaylist" )
         set_category( CAT_INPUT )
         set_subcategory( SUBCAT_INPUT_DEMUX )
diff --git a/modules/misc/lua/vlc.h b/modules/misc/lua/vlc.h
index f455f4e..68eea0f 100644
--- a/modules/misc/lua/vlc.h
+++ b/modules/misc/lua/vlc.h
@@ -48,6 +48,8 @@
 /*****************************************************************************
  * Module entry points
  *****************************************************************************/
+int Decrapify( vlc_object_t * );
+
 int FindArt( vlc_object_t * );
 
 int Import_LuaPlaylist( vlc_object_t * );
diff --git a/share/Makefile.am b/share/Makefile.am
index 43f2347..8a43fe9 100644
--- a/share/Makefile.am
+++ b/share/Makefile.am
@@ -190,6 +190,7 @@ DIST_osdmenu_default = \
 
 DIST_lua= \
 	lua/README.txt \
+	lua/decrapifier/standard.lua \
 	lua/meta/README.txt \
 	lua/meta/01_musicbrainz.lua \
 	lua/meta/10_googleimage.lua \
diff --git a/src/playlist/fetcher.c b/src/playlist/fetcher.c
index eaecfd0..dc0edee 100644
--- a/src/playlist/fetcher.c
+++ b/src/playlist/fetcher.c
@@ -33,6 +33,7 @@
 #include <limits.h>
 #include <vlc_art_finder.h>
 #include <vlc_memory.h>
+#include <vlc_decrapifier.h>
 
 #include "art.h"
 #include "fetcher.h"
@@ -122,10 +123,36 @@ void playlist_fetcher_Delete( playlist_fetcher_t *p_fetcher )
     free( p_fetcher );
 }
 
-
 /*****************************************************************************
  * Privates functions
  *****************************************************************************/
+
+/**
+ * This function's job is to call the movie name decrapifier
+ * Those plugins goal are to fill in information from the file itself.
+ * Without network connection.
+ */
+
+static void Decrapify( playlist_fetcher_t *p_fetcher, input_item_t *p_item )
+{
+    vlc_object_t *p_parent = VLC_OBJECT(p_fetcher->p_playlist);
+
+    decrapifier_t *p_decrapifier =
+    vlc_custom_create( p_parent, sizeof(*p_decrapifier), VLC_OBJECT_GENERIC,
+                      "movie name decrapifier" );
+    if(!p_decrapifier)
+        return;
+
+    vlc_object_attach( p_decrapifier, p_parent );
+    p_decrapifier->p_item = p_item;
+    
+    module_t *p_module = module_need( p_decrapifier,
+                                     "movie name decrapifier", NULL, false );
+    if( p_module )
+        module_unneed( p_decrapifier, p_module );
+    vlc_object_release( p_decrapifier );
+}
+
 /**
  * This function locates the art associated to an input item.
  * Return codes:
@@ -411,6 +438,8 @@ static void *Thread( void *p_data )
         /* Wait that the input item is preparsed if it is being played */
         WaitPreparsed( p_fetcher, p_item );
 
+        Decrapify( p_fetcher, p_item );
+
         /* Find art, and download it if needed */
         int i_ret = FindArt( p_fetcher, p_item );
         if( i_ret == 1 )




More information about the vlc-devel mailing list