[MPlayer-users] mplayer -subcp cp1250
Peter Hanzel
hanzelpeter at gmail.com
Wed Sep 17 14:51:12 CEST 2008
Hello.
I am using mplayer with fbdev but NOT using freetype for subtitles.
(mplayer 1.0rc1)
I have problem with displaying subtitles encoded in cp1250
mplayer -vo fbdev -subcp cp1250 film.avi
doesn't show correct chars for Slovak chars.
I have digged into source code and found that in subreader.c - subtitles are
recoded to UTF-8
but int libvo/font_load.c = still UNICODE is not applied. Chars are stored
to desc->font[chr] where chr is not unicode values.
If i compile it with freetype support. TTF subtitles works good.
I have delevoped this patch and it works now.
diff -Nur MPlayer-1.0rc1-orig/libvo/font_load.c
MPlayer-1.0rc1/libvo/font_load.c
--- MPlayer-1.0rc1-orig/libvo/font_load.c 2006-10-23 00:32:26.000000000
+0200
+++ MPlayer-1.0rc1/libvo/font_load.c 2008-09-17 14:12:23.000000000 +0200
@@ -238,11 +238,18 @@
if(strcmp(section,"[characters]")==0){
if(pdb==3){
- int chr=p[0][0];
+ int chr=strtol(p[0],NULL,0);
+ char *pos = strstr(sor, "U+");
+ pos+=2;
+ char buf[16];
+ sprintf(buf, "0x%c%c%c%c", pos[0], pos[1], pos[2], pos[3]);
+
+ chr=strtol(buf,NULL,0);
+if (chr>=0xe000)
+ chr=strtol(p[0], NULL, 0);
+
int start=atoi(p[1]);
int end=atoi(p[2]);
- if(sub_unicode && (chr>=0x80)) chr=(chr<<8)+p[0][1];
- else if(strlen(p[0])!=1) chr=strtol(p[0],NULL,0);
if(end<start) {
mp_msg(MSGT_OSD, MSGL_WARN, "error in font desc: end<start
for char '%c'\n",chr);
} else {
I have also another questions.
If I play video in fb console and than press "V" whole mplayer freezes and I
must kill it. (V should be toogle subtitle visibilty)
More information about the MPlayer-users
mailing list