From ebbefbb792737f5ccad94d3067c8289faedd534d Mon Sep 17 00:00:00 2001 From: Ravi Kiran K N Date: Wed, 11 Feb 2015 18:09:24 +0530 Subject: [PATCH] dvdemux: extract recording time Extracts the recorded time of the dv file from the metadata and puts it into the global tags. https://bugzilla.gnome.org/show_bug.cgi?id=743657 --- ext/dv/gstdvdemux.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ext/dv/gstdvdemux.c b/ext/dv/gstdvdemux.c index 352283a..be99647 100644 --- a/ext/dv/gstdvdemux.c +++ b/ext/dv/gstdvdemux.c @@ -303,6 +303,8 @@ gst_dvdemux_add_pad (GstDVDemux * dvdemux, GstStaticPadTemplate * template, GstPad *pad; GstEvent *event; gchar *stream_id; + gchar rec_datetime[40]; + GstDateTime *rec_dt; pad = gst_pad_new_from_static_template (template, template->name_template); @@ -341,6 +343,16 @@ gst_dvdemux_add_pad (GstDVDemux * dvdemux, GstStaticPadTemplate * template, tags = gst_tag_list_new (GST_TAG_CONTAINER_FORMAT, "DV", NULL); gst_tag_list_set_scope (tags, GST_TAG_SCOPE_GLOBAL); + + if (dv_get_recording_datetime (dvdemux->decoder, rec_datetime)) { + rec_dt = gst_date_time_new_from_iso8601_string (rec_datetime); + if (rec_dt) { + gst_tag_list_add (tags, GST_TAG_MERGE_REPLACE, GST_TAG_DATE_TIME, + rec_dt, NULL); + gst_date_time_unref (rec_dt); + } + } + if (dvdemux->videosrcpad) gst_pad_push_event (dvdemux->videosrcpad, gst_event_new_tag (gst_tag_list_ref (tags))); -- 2.7.4