changeset 603:73ae7a6d510e trunk

[svn] - don't fill in tuple fields with "".
author nenolod
date Sat, 03 Feb 2007 20:06:57 -0800
parents 20b8e735f69e
children 967e6adb3e8b
files ChangeLog src/console/Audacious_Driver.cxx
diffstat 2 files changed, 20 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sat Feb 03 08:55:23 2007 -0800
+++ b/ChangeLog	Sat Feb 03 20:06:57 2007 -0800
@@ -1,3 +1,11 @@
+2007-02-03 16:55:23 +0000  Yoshiki Yazawa <yaz@cc.rim.or.jp>
+  revision [1290]
+  - adaptation for playback API. make cuesheet plugin pass playback->output to real_ip.
+  
+  trunk/src/cue/cuesheet.c |   10 ++++++----
+  1 file changed, 6 insertions(+), 4 deletions(-)
+
+
 2007-02-02 22:42:27 +0000  William Pitcock <nenolod@sacredspiral.co.uk>
   revision [1288]
   - handle unavailable tuples better
--- a/src/console/Audacious_Driver.cxx	Sat Feb 03 08:55:23 2007 -0800
+++ b/src/console/Audacious_Driver.cxx	Sat Feb 03 20:06:57 2007 -0800
@@ -192,6 +192,14 @@
 
 // Get info
 
+static inline gchar *selective_strdup(const gchar *in)
+{
+	if (in == NULL || *in == '\0')
+		return NULL;
+
+	return g_strdup(in);
+}
+
 static TitleInput* get_track_ti( const char* path, track_info_t const& info, int track )
 {
 	TitleInput* ti = bmp_title_input_new();
@@ -199,12 +207,12 @@
 	{
 		ti->file_name  = g_path_get_basename( path );
 		ti->file_path  = g_path_get_dirname ( path );
-		ti->performer  = g_strdup( info.author );
-		ti->album_name = g_strdup( info.game );
-		ti->track_name = g_strdup( info.song ? info.song : ti->file_name );
+		ti->performer  = selective_strdup( info.author );
+		ti->album_name = selective_strdup( info.game );
+		ti->track_name = selective_strdup( info.song ? info.song : ti->file_name );
 		if ( info.track_count > 1 )
 			ti->track_number = track + 1;
-		ti->comment    = g_strdup( info.copyright );
+		ti->comment    = selective_strdup( info.copyright );
 		ti->genre      = g_strconcat( "Console: ", info.system, NULL );
 		
 		int length = info.length;