[totem/gnome-3-10] backend: Fix Year tag not showing in some cases



commit 037fe8ba7d5f3b6cac04ec9c90e1a9729c7d1c31
Author: Bastien Nocera <hadess hadess net>
Date:   Thu Aug 22 17:39:50 2013 +0200

    backend: Fix Year tag not showing in some cases
    
    The DATE tag might not contain the year, but the DATE_TIME tag
    might, so try and use that if the first one fails.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=706397

 src/backend/bacon-video-widget.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/src/backend/bacon-video-widget.c b/src/backend/bacon-video-widget.c
index fc2f5bf..5b8c091 100644
--- a/src/backend/bacon-video-widget.c
+++ b/src/backend/bacon-video-widget.c
@@ -5379,11 +5379,16 @@ bacon_video_widget_get_metadata_string (BaconVideoWidget * bvw,
     case BVW_INFO_YEAR:
       if (bvw->priv->tagcache != NULL) {
         GDate *date;
+        GstDateTime *datetime;
 
         if ((res = gst_tag_list_get_date (bvw->priv->tagcache,
                                           GST_TAG_DATE, &date))) {
           string = g_strdup_printf ("%d", g_date_get_year (date));
           g_date_free (date);
+        } else if ((res = gst_tag_list_get_date_time (bvw->priv->tagcache,
+                                                      GST_TAG_DATE_TIME, &datetime))) {
+          string = g_strdup_printf ("%d", gst_date_time_get_year (datetime));
+          gst_date_time_unref (datetime);
         }
       }
       break;


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