From 10b303d9799f411d2c185d963b4e8875e872e335 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rafa=C3=ABl=20Carr=C3=A9?= Date: Sat, 23 Jun 2007 19:00:52 +0000 Subject: [PATCH] Removes meta_export_t Modify meta writer callback to take an input_item_t as argument, so a file non playing can be written --- include/vlc_common.h | 1 - include/vlc_meta.h | 6 ------ modules/meta_engine/taglib.cpp | 14 ++++++++++---- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/include/vlc_common.h b/include/vlc_common.h index 0aef0661c6..9707358799 100644 --- a/include/vlc_common.h +++ b/include/vlc_common.h @@ -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; diff --git a/include/vlc_meta.h b/include/vlc_meta.h index 28bd4acfce..3a528de4c9 100644 --- a/include/vlc_meta.h +++ b/include/vlc_meta.h @@ -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 diff --git a/modules/meta_engine/taglib.cpp b/modules/meta_engine/taglib.cpp index 0b2b81b2f4..bf9dd0c96c 100644 --- a/modules/meta_engine/taglib.cpp +++ b/modules/meta_engine/taglib.cpp @@ -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(); -- 2.39.2