Commit 5786a1b6 authored by Tim-Philipp Müller's avatar Tim-Philipp Müller 🐠

GST_TAG_DATE takes a date in julian calendar days, not a year (partially fixes #170306)

Original commit message from CVS:
GST_TAG_DATE takes a date in julian calendar days, not a year (partially fixes #170306)
parent 91cd2039
2005-03-21 Tim-Philipp Müller <tim at centricular dot net>
* ext/lame/gstlame.c: (add_one_tag):
* gst-libs/gst/riff/riff-read.c: (gst_riff_read_info):
* gst/asfdemux/gstasfdemux.c:
(gst_asf_demux_process_ext_content_desc):
* gst/matroska/matroska-demux.c:
(gst_matroska_demux_parse_metadata):
GST_TAG_DATE takes a date in julian calendar days, not a year
(partially fixes #170306)
2005-03-20 Benjamin Otte <in7y118@public.uni-hamburg.de>
* ext/jack/gstjack.c: (gst_jack_loop):
......
......@@ -933,20 +933,45 @@ gst_riff_read_info (GstRiffRead * riff)
}
if (name && name[0] != '\0') {
GValue src = { 0 }
, dest = {
0};
GType dest_type = gst_tag_get_type (type);
have_tags = TRUE;
g_value_init (&src, G_TYPE_STRING);
g_value_set_string (&src, name);
g_value_init (&dest, dest_type);
g_value_transform (&src, &dest);
g_value_unset (&src);
gst_tag_list_add_values (taglist, GST_TAG_MERGE_APPEND,
type, &dest, NULL);
g_value_unset (&dest);
if (strcmp (type, GST_TAG_DATE) == 0) {
GDate *date;
guint y, d = 1, m = 1;
gchar *check = name;
y = strtoul (check, &check, 10);
if (*check == '-') {
check++;
m = strtoul (check, &check, 10);
if (*check == '-') {
check++;
d = strtoul (check, &check, 10);
}
}
if (*check != '\0')
break;
if (y == 0)
break;
date = g_date_new_dmy (d, m, y);
y = g_date_get_julian (date);
g_date_free (date);
gst_tag_list_add (taglist, GST_TAG_MERGE_APPEND, type, y, NULL);
have_tags = TRUE;
} else {
GValue src = { 0, };
GValue dest = { 0, };
GType dest_type = gst_tag_get_type (type);
have_tags = TRUE;
g_value_init (&src, G_TYPE_STRING);
g_value_set_string (&src, name);
g_value_init (&dest, dest_type);
g_value_transform (&src, &dest);
g_value_unset (&src);
gst_tag_list_add_values (taglist, GST_TAG_MERGE_APPEND,
type, &dest, NULL);
g_value_unset (&dest);
}
}
g_free (name);
} else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment