diff src/madplug/input.c @ 750:5d8556c9949c trunk

[svn] - handle condition where track_name is not there, but stream_name is.
author nenolod
date Wed, 28 Feb 2007 07:01:26 -0800
parents 6ea974a229a8
children efc2d680cac8
line wrap: on
line diff
--- a/src/madplug/input.c	Wed Feb 28 04:38:53 2007 -0800
+++ b/src/madplug/input.c	Wed Feb 28 07:01:26 2007 -0800
@@ -445,7 +445,12 @@
         info->title = g_strdup(track_name);
         info->tuple->track_name = g_strdup(track_name);
         info->tuple->album_name = g_strdup(stream_name);
-        tmp = g_strdup_printf("%s (%s)", track_name, stream_name);
+
+        if (track_name != NULL)
+            tmp = g_strdup_printf("%s (%s)", track_name, stream_name);
+        else
+	    tmp = g_strdup(stream_name);
+
         mad_plugin->set_info(tmp,
                              -1, // indicates the stream is unseekable
                              info->bitrate, info->freq, info->channels);
@@ -506,7 +511,12 @@
         madinfo->title = g_strdup(track_name);
         madinfo->tuple->track_name = g_strdup(track_name);
         madinfo->tuple->album_name = g_strdup(stream_name);
-        tmp = g_strdup_printf("%s (%s)", track_name, stream_name);
+
+        if (track_name != NULL)
+            tmp = g_strdup_printf("%s (%s)", track_name, stream_name);
+        else
+	    tmp = g_strdup(stream_name);
+
         mad_plugin->set_info(tmp,
                              -1, // indicate the stream is unseekable
 			     madinfo->bitrate, madinfo->freq, madinfo->channels);