2007-03-10 Tim-Philipp Müller <tim at centricular dot net>
+ * gst-libs/gst/tag/gstvorbistag.c: (gst_vorbis_tag_add):
+ Also accept partial dates with only year and month,
+ like 1999-12-00 (fixes #410396 even more).
+
+ * tests/check/libs/tag.c: (GST_START_TEST):
+ Add unit test for the above.
+
+2007-03-10 Tim-Philipp Müller <tim at centricular dot net>
+
* tests/check/elements/subparse.c: (GST_START_TEST),
(subparse_suite):
Add unit test for MPL2 subtitle format (#413799).
}
}
- if (y != 0 && m == 0 && d == 0) {
- /* accept dates of the form 2007-00-00 as 2007-01-01 */
- m = 1;
- d = 1;
+ /* accept dates like 2007-00-00 and 2007-05-00 */
+ if (y != 0) {
+ if (m == 0 && d == 0)
+ m = d = 1;
+ else if (m != 0 && d == 0)
+ d = 1;
}
/* date might be followed by a time */
g_date_free (date);
gst_tag_list_free (list);
}
+
+ /* check date with valid month, but day of 00 */
+ {
+ GDate *date = NULL;
+
+ list = gst_tag_list_new ();
+ gst_vorbis_tag_add (list, "DATE", "1992-05-00");
+
+ fail_unless (gst_tag_list_get_date_index (list, GST_TAG_DATE, 0, &date));
+ fail_unless (date != NULL);
+ fail_unless (g_date_get_year (date) == 1992);
+ fail_unless (g_date_get_month (date) == G_DATE_MAY);
+
+ g_date_free (date);
+ gst_tag_list_free (list);
+ }
}
GST_END_TEST;