Commit 88e94fc2 authored by René Stadler's avatar René Stadler Committed by Tim-Philipp Müller
Browse files

gst-libs/gst/tag/gstvorbistag.c: Parse date strings in vorbis comments that...

gst-libs/gst/tag/gstvorbistag.c: Parse date strings in vorbis comments that have an invalid (zero) month or day (#410...

Original commit message from CVS:
Patch by: René Stadler <mail at renestadler de>
* gst-libs/gst/tag/gstvorbistag.c: (gst_vorbis_tag_add):
Parse date strings in vorbis comments that have an invalid (zero)
month or day (#410396).
* tests/check/libs/tag.c: (GST_START_TEST):
Test case for the above.
parent 2770d0fb
2007-02-25 Tim-Philipp Müller <tim at centricular dot net>
Patch by: René Stadler <mail at renestadler de>
* gst-libs/gst/tag/gstvorbistag.c: (gst_vorbis_tag_add):
Parse date strings in vorbis comments that have an invalid (zero)
month or day (#410396).
* tests/check/libs/tag.c: (GST_START_TEST):
Test case for the above.
2007-02-24 Tim-Philipp Müller <tim at centricular dot net>
Patch by: Loïc Minier <lool+gnome at via ecp fr>
......@@ -254,6 +254,12 @@ gst_vorbis_tag_add (GstTagList * list, const gchar * tag, const gchar * value)
}
}
if (y != 0 && m == 0 && d == 0) {
/* accept dates of the form 2007-00-00 as 2007-01-01 */
m = 1;
d = 1;
}
/* date might be followed by a time */
if ((*check == '\0' || g_ascii_isspace (*check)) && y != 0 &&
g_date_valid_dmy (d, m, y)) {
......
......@@ -515,6 +515,21 @@ GST_START_TEST (test_vorbis_tags)
g_date_free (date);
gst_tag_list_free (list);
}
/* check date with month/day of 00-00 */
{
GDate *date = NULL;
list = gst_tag_list_new ();
gst_vorbis_tag_add (list, "DATE", "1992-00-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);
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