[rygel] media-export: Fix critical on harvesting audio



commit 8c93021537546aabfef432a2cd7786abb3fb6fb2
Author: Jens Georg <jensg openismus com>
Date:   Tue Feb 12 11:43:05 2013 +0100

    media-export: Fix critical on harvesting audio
    
    Additionally port to GST_TAG_DATE_TIME since _DATE seems to be
    deprecated/unused.

 .../rygel-media-export-item-factory.vala           |   15 +++++++--------
 1 files changed, 7 insertions(+), 8 deletions(-)
---
diff --git a/src/plugins/media-export/rygel-media-export-item-factory.vala b/src/plugins/media-export/rygel-media-export-item-factory.vala
index c86176d..21f11a9 100644
--- a/src/plugins/media-export/rygel-media-export-item-factory.vala
+++ b/src/plugins/media-export/rygel-media-export-item-factory.vala
@@ -308,15 +308,14 @@ namespace Rygel.MediaExport.ItemFactory {
             !tags.get_string (Tags.TITLE, out title)) {
             title = file_info.get_display_name ();
 
-            GLib.Date? date;
-            if (tags.get_date (Tags.DATE, out date) &&
-                date.valid ()) {
-                char[] datestr = new char[30];
-                date.strftime (datestr, "%F");
-                item.date = (string) datestr;
-            }
         }
-        
+
+        // This assumes the datetime is valid; checking some demuxers this
+        Gst.DateTime? dt = null;
+        if (tags != null && tags.get_date_time (Tags.DATE_TIME, out dt)) {
+            item.date = dt.to_iso8601_string ();
+        }
+
         item.title = title;
 
         // use mtime if no time tag was available


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