From 0cff917a519da449a9dc6f26def7a1b4531c2056 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Tue, 30 Nov 2010 19:21:23 +0100 Subject: [PATCH] avidemux: Also emit DateTime tag https://bugzilla.gnome.org/show_bug.cgi?id=636143 --- gst/avi/gstavidemux.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/gst/avi/gstavidemux.c b/gst/avi/gstavidemux.c index f29871c1c5..74f4918830 100644 --- a/gst/avi/gstavidemux.c +++ b/gst/avi/gstavidemux.c @@ -3380,9 +3380,12 @@ header_wrong_avih: } static void -gst_avi_demux_add_date_tag (GstAviDemux * avi, gint y, gint m, gint d) +gst_avi_demux_add_date_tag (GstAviDemux * avi, gint y, gint m, gint d, + gint h, gint min, gint s) { GDate *date; + GstDateTime *dt; + date = g_date_new_dmy (d, m, y); if (!g_date_valid (date)) { /* bogus date */ @@ -3391,12 +3394,19 @@ gst_avi_demux_add_date_tag (GstAviDemux * avi, gint y, gint m, gint d) return; } + dt = gst_date_time_new_local_time (y, m, d, h, min, s); + if (avi->globaltags == NULL) avi->globaltags = gst_tag_list_new (); gst_tag_list_add (avi->globaltags, GST_TAG_MERGE_REPLACE, GST_TAG_DATE, date, NULL); g_date_free (date); + if (dt) { + gst_tag_list_add (avi->globaltags, GST_TAG_MERGE_REPLACE, GST_TAG_DATE_TIME, + dt, NULL); + gst_date_time_unref (dt); + } } static void @@ -3410,7 +3420,7 @@ gst_avi_demux_parse_idit_nums_only (GstAviDemux * avi, gchar * data) GST_WARNING_OBJECT (avi, "Failed to parse IDIT tag"); return; } - gst_avi_demux_add_date_tag (avi, y, m, d); + gst_avi_demux_add_date_tag (avi, y, m, d, 0, 0, 0); } static gint @@ -3461,7 +3471,7 @@ gst_avi_demux_parse_idit_text (GstAviDemux * avi, gchar * data) return; } month = get_month_num (monthstr, strlen (monthstr)); - gst_avi_demux_add_date_tag (avi, year, month, day); + gst_avi_demux_add_date_tag (avi, year, month, day, hour, min, sec); } static void