mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-26 18:20:44 +00:00
tag: id3v2: Some more debug info. No need to check whether the string returned by g_convert() is real...
Original commit message from CVS: * gst-libs/gst/tag/id3v2frames.c: (parse_insert_string_field): Some more debug info. No need to check whether the string returned by g_convert() is really UTF-8 - either it is or we get NULL returned.
This commit is contained in:
parent
9f4827af39
commit
2fd7d6c3eb
1 changed files with 12 additions and 6 deletions
|
@ -671,14 +671,20 @@ static void
|
||||||
parse_insert_string_field (const gchar * encoding, gchar * data, gint data_size,
|
parse_insert_string_field (const gchar * encoding, gchar * data, gint data_size,
|
||||||
GArray * fields)
|
GArray * fields)
|
||||||
{
|
{
|
||||||
gchar *field;
|
gchar *field = NULL;
|
||||||
|
|
||||||
field = g_convert (data, data_size, "UTF-8", encoding, NULL, NULL, NULL);
|
if (strcmp (encoding, "UTF-8") != 0) {
|
||||||
if (field && !g_utf8_validate (field, -1, NULL)) {
|
field = g_convert (data, data_size, "UTF-8", encoding, NULL, NULL, NULL);
|
||||||
GST_DEBUG ("%s was bad UTF-8. Ignoring", field);
|
if (field == NULL) {
|
||||||
g_free (field);
|
GST_WARNING ("could not convert string from %s to UTF-8. Ignoring",
|
||||||
field = NULL;
|
encoding);
|
||||||
|
}
|
||||||
|
} else if (g_utf8_validate (data, data_size, NULL)) {
|
||||||
|
field = g_strndup (data, data_size);
|
||||||
|
} else {
|
||||||
|
GST_WARNING ("alleged UTF-8 string is not valid UTF-8. Ignoring");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (field)
|
if (field)
|
||||||
g_array_append_val (fields, field);
|
g_array_append_val (fields, field);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue