[vlc-devel] commit: taglib: write meta in Xiph format. ( only one advanced meta is writen for the moment) ( Rémi Duraffort )

git version control git at videolan.org
Mon Dec 29 19:33:42 CET 2008


vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Mon Dec 29 19:21:40 2008 +0100| [8505bf177a1679b9bb472ce3e0f99a93eab11453] | committer: Rémi Duraffort 

taglib: write meta in Xiph format. (only one advanced meta is writen for the moment)

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

 modules/meta_engine/taglib.cpp |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/modules/meta_engine/taglib.cpp b/modules/meta_engine/taglib.cpp
index d820aa6..d2b3c98 100644
--- a/modules/meta_engine/taglib.cpp
+++ b/modules/meta_engine/taglib.cpp
@@ -494,8 +494,22 @@ static int WriteMetaToId2v2( ID3v2::Tag* tag, input_item_t* p_item )
  * @param p_input: the input item
  * @return VLC_SUCCESS if everything goes ok
  */
-static int WriteMetaToXiph( Ogg::XiphComment* tag, input_item_t* p_input )
+static int WriteMetaToXiph( Ogg::XiphComment* tag, input_item_t* p_item )
 {
+    char* psz_meta;
+#define WRITE( metaName, keyName )                      \
+    psz_meta = input_item_Get##metaName( p_item );      \
+    if( psz_meta )                                      \
+    {                                                   \
+        String key( keyName, String::UTF8 );            \
+        String value( psz_meta, String::UTF8 );         \
+        tag->addField( key, value, true );              \
+    }                                                   \
+    free( psz_meta );
+
+    WRITE( Copyright, "COPYRIGHT" );
+
+#undef WRITE
     return VLC_SUCCESS;
 }
 




More information about the vlc-devel mailing list