changeset 1003:6100889b8f06 trunk

[svn] Add an empty tag obliterator(TM) as designed by nenolod for mpg123.
author chainsaw
date Tue, 02 May 2006 17:04:52 -0700
parents cb33ddea6d31
children 72b6e18c94b9
files Plugins/Input/musepack/libmpc.cpp
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/Plugins/Input/musepack/libmpc.cpp	Tue May 02 16:37:38 2006 -0700
+++ b/Plugins/Input/musepack/libmpc.cpp	Tue May 02 17:04:52 2006 -0700
@@ -1,7 +1,7 @@
 #include "libmpc.h"
 
 #define FORCED_THREAD_STACKSIZE 1024 * 1000
-
+#define REMOVE_NONEXISTANT_TAG(x)   if (!*x) { x = NULL; }
 
 using TagLib::MPC::File;
 using TagLib::Tag;
@@ -307,10 +307,15 @@
     Tag* poTag = oFile.tag();
     MpcInfo tags = {0};
     tags.title   = g_strdup(poTag->title().toCString(true));
+    REMOVE_NONEXISTANT_TAG(tags.title);
     tags.artist  = g_strdup(poTag->artist().toCString(true));
+    REMOVE_NONEXISTANT_TAG(tags.artist);
     tags.album   = g_strdup(poTag->album().toCString(true));
+    REMOVE_NONEXISTANT_TAG(tags.album);
     tags.genre   = g_strdup(poTag->genre().toCString(true));
+    REMOVE_NONEXISTANT_TAG(tags.genre);
     tags.comment = g_strdup(poTag->comment().toCString(true));
+    REMOVE_NONEXISTANT_TAG(tags.comment);
     tags.year    = poTag->year();
     tags.track   = poTag->track();
     TagLib::APE::Tag* ape = oFile.APETag(false);