[totem] backend: Don't report empty properties



commit b836edfd648a747d6a1356c2d24cf82794c2fd89
Author: Bastien Nocera <hadess hadess net>
Date:   Mon Jan 7 12:13:32 2013 +0100

    backend: Don't report empty properties
    
    When a property only contains spaces, trim them out to avoid
    empty properties.

 src/backend/bacon-video-widget.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/src/backend/bacon-video-widget.c b/src/backend/bacon-video-widget.c
index 657706b..c38881e 100644
--- a/src/backend/bacon-video-widget.c
+++ b/src/backend/bacon-video-widget.c
@@ -5487,8 +5487,10 @@ bacon_video_widget_get_metadata_string (BaconVideoWidget * bvw,
   /* Remove line feeds */
   if (string && strstr (string, "\n") != NULL)
     g_strdelimit (string, "\n", ' ');
+  if (string != NULL)
+    string = g_strstrip (string);
 
-  if (res && string && g_utf8_validate (string, -1, NULL)) {
+  if (res && string && *string != '\0' && g_utf8_validate (string, -1, NULL)) {
     g_value_take_string (value, string);
     GST_DEBUG ("%s = '%s'", get_type_name (BVW_TYPE_METADATA_TYPE, type), string);
   } else {



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