Commit 787e5810 authored by Tim-Philipp Müller's avatar Tim-Philipp Müller
Browse files

gst-libs/gst/tag/gstvorbistag.c: Parse dates that are followed by a time as well (#357532).

Original commit message from CVS:
* gst-libs/gst/tag/gstvorbistag.c: (gst_vorbis_tag_add):
Parse dates that are followed by a time as well (#357532).
* tests/check/libs/tag.c: (test_vorbis_tags):
Add unit test for this.
parent f3066553
2006-09-25 Tim-Philipp Müller <tim at centricular dot net>
* gst-libs/gst/tag/gstvorbistag.c: (gst_vorbis_tag_add):
Parse dates that are followed by a time as well (#357532).
* tests/check/libs/tag.c: (test_vorbis_tags):
Add unit test for this.
2006-09-23 Tim-Philipp Müller <tim at centricular dot net>
 
* gst/audioconvert/gstaudioconvert.c: (make_lossless_changes),
......@@ -244,7 +244,10 @@ gst_vorbis_tag_add (GstTagList * list, const gchar * tag, const gchar * value)
d = strtoul (check, &check, 10);
}
}
if (*check == '\0' && y != 0 && g_date_valid_dmy (d, m, y)) {
/* date might be followed by a time */
if ((*check == '\0' || g_ascii_isspace (*check)) && y != 0 &&
g_date_valid_dmy (d, m, y)) {
GDate *date;
date = g_date_new_dmy (d, m, y);
......
......@@ -497,6 +497,23 @@ GST_START_TEST (test_vorbis_tags)
gst_buffer_unref (buf);
}
/* check date with time */
{
GDate *date = NULL;
list = gst_tag_list_new ();
gst_vorbis_tag_add (list, "DATE", "2006-09-25 22:02:38");
fail_unless (gst_tag_list_get_date_index (list, GST_TAG_DATE, 0, &date));
fail_unless (date != NULL);
fail_unless (g_date_get_day (date) == 25);
fail_unless (g_date_get_month (date) == G_DATE_SEPTEMBER);
fail_unless (g_date_get_year (date) == 2006);
g_date_free (date);
gst_tag_list_free (list);
}
}
GST_END_TEST;
......
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