LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 891|回复: 6

rhythmbox 0.8.0的中文补丁,支持xine后端的。

[复制链接]
发表于 2004-4-17 12:29:28 | 显示全部楼层 |阅读模式
这个补丁是在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]
发表于 2004-4-17 12:44:27 | 显示全部楼层
不错,
我刚刚编译完0.8  
发表于 2004-4-17 12:50:25 | 显示全部楼层
如果编译xine后端的是不是就可以播放real的格式啊??
发表于 2004-4-17 13:42:18 | 显示全部楼层
赫赫,这个patch太乱了,我后来又改写过一次,看起来在0.8下面还能用

rhythmbox-0.8.0 $ patch -p1  < /backup/patches/rhythmbox-0.72-cjk.diff
patching file data/ui/rhythmbox-ui.xml
patching file metadata/monkey-media/stream-info-impl/mp3-stream-info-impl.c
patching file widgets/rb-song-info.c
Hunk #1 succeeded at 842 (offset 1 line).
Hunk #2 succeeded at 867 (offset 1 line).

这里下载
 楼主| 发表于 2004-4-17 14:59:32 | 显示全部楼层
最初由 penny 发表
赫赫,这个patch太乱了,我后来又改写过一次,看起来在0.8下面还能用

rhythmbox-0.8.0 $ patch -p1  < /backup/patches/rhythmbox-0.72-cjk.diff
patching file data/ui/rhythmbox-ui.xml
patching file metadata/monkey-media/stream-info-impl/mp3-stream-info-impl.c
patching file widgets/rb-song-info.c
Hunk #1 succeeded at 842 (offset 1 line).
Hunk #2 succeeded at 867 (offset 1 line).

这里下载


早点提供多好阿, 就可以省很多事情了
还好用gentoo处理起来野比较容易。
发表于 2004-4-17 20:31:16 | 显示全部楼层
还不错

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
发表于 2004-4-24 13:36:02 | 显示全部楼层
thanks
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表