|
这个补丁是在penny的补丁基础上面做的。谢谢penny
[PHP]diff -uNrp rhythmbox-0.8.0.orig/metadata/monkey-media/stream-info-impl/mp3-stream-info-impl.c rhythmbox-0.8.0/metadata/monkey-media/stream-info-impl/mp3-stream-info-impl.c
--- rhythmbox-0.8.0.orig/metadata/monkey-media/stream-info-impl/mp3-stream-info-impl.c 2004-04-16 03:31:41.000000000 +0800
+++ rhythmbox-0.8.0/metadata/monkey-media/stream-info-impl/mp3-stream-info-impl.c 2004-04-17 12:19:57.372823152 +0800
@@ -664,7 +664,7 @@ MP3_stream_info_impl_id3_tag_get_utf8 (s
const union id3_field *field;
const id3_ucs4_t *ucs4 = NULL;
id3_utf8_t *utf8 = NULL;
-
+
frame = id3_tag_findframe (tag, field_name, 0);
if (frame == 0)
return NULL;
@@ -673,24 +673,38 @@ MP3_stream_info_impl_id3_tag_get_utf8 (s
nstrings = id3_field_getnstrings (field);
for (j = 0; j < nstrings; j++)
{
- id3_utf8_t *tmp = NULL;
+// id3_utf8_t *tmp = NULL;
+ id3_latin1_t *tmp = NULL;
+ id3_latin1_t *tmp1 = NULL;
ucs4 = id3_field_getstrings (field, j);
if (strcmp (field_name, ID3_FRAME_GENRE) == 0)
ucs4 = id3_genre_name (ucs4);
-
- tmp = id3_ucs4_utf8duplicate (ucs4);
- if (strcmp (tmp, "") != 0)
+
+// tmp = id3_ucs4_utf8duplicate (ucs4);
+ //tmp = "";
+ tmp = id3_ucs4_latin1duplicate (ucs4);
+ if (tmp && !g_utf8_validate (tmp, -1, NULL))
+ {
+ utf8 = g_locale_to_utf8(tmp, -1, NULL, NULL, NULL);
+ g_free(tmp);
+ tmp = NULL;
+ }
+ else if (strcmp(tmp, "") != 0)
+ {
utf8 = tmp;
+ }
else
- g_free (tmp);
+ {
+ g_free(tmp);
+ }
}
-
if (utf8 && !g_utf8_validate (utf8, -1, NULL)) {
g_warning ("Invalid UTF-8 in %s field in mp3 file\n", field_name);
/* Should rb_unicodify really be used to convert ucs4 data to utf8? */
utf8 = rb_unicodify ((char *) ucs4);
+// utf8 = "";
}
return utf8;[/PHP] |
|