diff options
-rw-r--r-- | ChangeLog | 11 | ||||
-rw-r--r-- | gst-libs/gst/riff/riff-read.c | 53 |
2 files changed, 50 insertions, 14 deletions
@@ -1,3 +1,14 @@ +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): diff --git a/gst-libs/gst/riff/riff-read.c b/gst-libs/gst/riff/riff-read.c index 21cdbbca..ebcc2080 100644 --- a/gst-libs/gst/riff/riff-read.c +++ b/gst-libs/gst/riff/riff-read.c @@ -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 { |