+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),
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);
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;