gst/tags/gstvorbistag.c: make sure parsed vorbis comments are properly encoded in UTF-8 before adding them to a GstTa...

Original commit message from CVS:
2004-06-10  Christophe Fergeau  <teuf@gnome.org>

* gst/tags/gstvorbistag.c: (gst_vorbis_tag_add): make sure parsed
vorbis comments are properly encoded in UTF-8 before adding them
to a GstTagList
This commit is contained in:
Christophe Fergeau 2004-06-09 22:12:33 +00:00
parent 851ad864d0
commit 7a3955fdc8
2 changed files with 18 additions and 2 deletions

View file

@ -1,3 +1,9 @@
2004-06-10 Christophe Fergeau <teuf@gnome.org>
* gst/tags/gstvorbistag.c: (gst_vorbis_tag_add): make sure parsed
vorbis comments are properly encoded in UTF-8 before adding them
to a GstTagList
2004-06-09 Benjamin Otte <otte@gnome.org>
* ext/alsa/gstalsa.c: (add_channels):

View file

@ -319,9 +319,19 @@ gst_vorbis_tag_add (GstTagList * list, const gchar * tag, const gchar * value)
gst_tag_list_add (list, GST_TAG_MERGE_APPEND, gst_tag, tmp, NULL);
}
break;
case G_TYPE_STRING:
gst_tag_list_add (list, GST_TAG_MERGE_APPEND, gst_tag, value, NULL);
case G_TYPE_STRING:{
gchar *valid;
if (!g_utf8_validate (value, -1, (const gchar **) &valid)) {
valid = g_strndup (value, valid - value);
g_warning ("Invalid vorbis comment tag, truncated it to %s\n", valid);
} else {
valid = g_strdup (value);
}
gst_tag_list_add (list, GST_TAG_MERGE_APPEND, gst_tag, valid, NULL);
g_free (valid);
break;
}
case G_TYPE_DOUBLE:
gst_tag_list_add (list, GST_TAG_MERGE_APPEND, gst_tag, g_strtod (value,
NULL), NULL);