mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-19 06:46:38 +00:00
isomp4: Use full date time if available
The ©day tag contains a full date time, use it for the DATE_TIME tag instead of just the DATE tag. This overrules the unreliable qt creation time. https://bugzilla.gnome.org/show_bug.cgi?id=731029
This commit is contained in:
parent
9cbde904e8
commit
c2cce8a9fc
1 changed files with 8 additions and 0 deletions
|
@ -12634,6 +12634,7 @@ qtdemux_tag_add_date (GstQTDemux * qtdemux, GstTagList * taglist,
|
||||||
const char *tag, const char *dummy, GNode * node)
|
const char *tag, const char *dummy, GNode * node)
|
||||||
{
|
{
|
||||||
GNode *data;
|
GNode *data;
|
||||||
|
GstDateTime *datetime = NULL;
|
||||||
char *s;
|
char *s;
|
||||||
int len;
|
int len;
|
||||||
int type;
|
int type;
|
||||||
|
@ -12648,6 +12649,13 @@ qtdemux_tag_add_date (GstQTDemux * qtdemux, GstTagList * taglist,
|
||||||
|
|
||||||
s = g_strndup ((char *) data->data + 16, len - 16);
|
s = g_strndup ((char *) data->data + 16, len - 16);
|
||||||
GST_DEBUG_OBJECT (qtdemux, "adding date '%s'", s);
|
GST_DEBUG_OBJECT (qtdemux, "adding date '%s'", s);
|
||||||
|
datetime = gst_date_time_new_from_iso8601_string (s);
|
||||||
|
if (datetime != NULL) {
|
||||||
|
gst_tag_list_add (taglist, GST_TAG_MERGE_REPLACE, GST_TAG_DATE_TIME,
|
||||||
|
datetime, NULL);
|
||||||
|
gst_date_time_unref (datetime);
|
||||||
|
}
|
||||||
|
|
||||||
ret = sscanf (s, "%u-%u-%u", &y, &m, &d);
|
ret = sscanf (s, "%u-%u-%u", &y, &m, &d);
|
||||||
if (ret >= 1 && y > 1500 && y < 3000) {
|
if (ret >= 1 && y > 1500 && y < 3000) {
|
||||||
GDate *date;
|
GDate *date;
|
||||||
|
|
Loading…
Reference in a new issue