]> git.sesse.net Git - vlc/commitdiff
Removes meta_export_t
authorRafaël Carré <funman@videolan.org>
Sat, 23 Jun 2007 19:00:52 +0000 (19:00 +0000)
committerRafaël Carré <funman@videolan.org>
Sat, 23 Jun 2007 19:00:52 +0000 (19:00 +0000)
Modify meta writer callback to take an input_item_t as argument, so a file non playing can be written

include/vlc_common.h
include/vlc_meta.h
modules/meta_engine/taglib.cpp

index 0aef0661c678bbcff967f656ff951335aeb798a5..97073587994444424081edb9e1718b06f518cd5e 100644 (file)
@@ -429,7 +429,6 @@ typedef struct vlm_message_t vlm_message_t;
 
 /* divers */
 typedef struct vlc_meta_t    vlc_meta_t;
-typedef struct meta_export_t meta_export_t;
 
 /* Stats */
 typedef struct counter_t     counter_t;
index 28bd4acfcea3fef70f7c8b1ec68a276841f0498d..3a528de4c9df78cc857235d39f42daad8b5bc795 100644 (file)
@@ -227,12 +227,6 @@ enum {
     ALBUM_ART_ALL
 };
 
-struct meta_export_t
-{
-    input_item_t *p_item;
-    const char *psz_file;
-};
-
 #define VLC_META_ENGINE_TITLE           0x00000001
 #define VLC_META_ENGINE_ARTIST          0x00000004
 #define VLC_META_ENGINE_GENRE           0x00000008
index 0b2b81b2f4a2b22e75f56e14d32d9c1c0e1b5b61..bf9dd0c96c6f4ef705f581e45467ddb7ab51b813 100644 (file)
@@ -168,11 +168,17 @@ static int ReadMeta( vlc_object_t *p_this )
 
 static int WriteMeta( vlc_object_t *p_this )
 {
-    playlist_t *p_playlist = (playlist_t *)p_this;
-    meta_export_t *p_export = (meta_export_t *)p_playlist->p_private;
-    input_item_t *p_item = p_export->p_item;
+    input_item_t *p_item = (input_item_t *)p_this;
 
-    TagLib::FileRef f( p_export->psz_file );
+    char *psz_uri = p_item->psz_uri;
+    /* we can write meta data only in a file */
+    if( !strncmp( psz_uri, "file://", 7 ) )
+        psz_uri += 7;
+    /* if the file is specified with its path, not prefixed with file:// */
+    else if( strncmp( psz_uri, "/", 1 ) )
+        return VLC_EGENERIC;
+
+    TagLib::FileRef f( psz_uri );
     if( !f.isNull() && f.tag() )
     {
         TagLib::Tag *tag = f.tag();