[gnac] Handled properly track-gain and track-peak tags



commit 731ab75bbc09fd00c00f0374c6d20f632a4178e7
Author: Benoît Dupasquier <bdupasqu src gnome org>
Date:   Sat May 29 15:51:26 2010 +0100

    Handled properly track-gain and track-peak tags

 src/gnac-properties.c |   21 ++++++++++++++-------
 1 files changed, 14 insertions(+), 7 deletions(-)
---
diff --git a/src/gnac-properties.c b/src/gnac-properties.c
index e1e7588..eb0f7aa 100644
--- a/src/gnac-properties.c
+++ b/src/gnac-properties.c
@@ -377,14 +377,21 @@ gnac_properties_get_property_from_value(const gchar  *name,
     if (val == 0) return NULL;
     else return g_strdup_printf("%d", val);
   }
-  if (LIBGNAC_METADATA_TAG_IS_FILENAME(name) || 
-           LIBGNAC_METADATA_TAG_IS_LOCATION(name) ||
-           LIBGNAC_METADATA_TAG_IS_AUDIO_CODEC(name) ||
-           LIBGNAC_METADATA_TAG_IS_TRACK_GAIN(name) ||
-           LIBGNAC_METADATA_TAG_IS_TRACK_PEAK(name) ||
-           LIBGNAC_METADATA_TAG_IS_MODE(name))
+  if (LIBGNAC_METADATA_TAG_IS_TRACK_GAIN(name) ||
+      LIBGNAC_METADATA_TAG_IS_TRACK_PEAK(name))
   {
-    return g_markup_escape_text(g_value_get_string(value), -1);
+    gdouble val = g_value_get_double(value);
+    if (val == 0) return NULL;
+    else return g_strdup_printf("%g", val);
+  }
+  if (LIBGNAC_METADATA_TAG_IS_FILENAME(name)    ||
+      LIBGNAC_METADATA_TAG_IS_LOCATION(name)    ||
+      LIBGNAC_METADATA_TAG_IS_AUDIO_CODEC(name) ||
+      LIBGNAC_METADATA_TAG_IS_MODE(name))
+  {
+    const gchar *str = g_value_get_string(value);
+    if (!str) return NULL;
+    return g_markup_escape_text(str, -1);
   }
   return NULL;
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]