[Mplayer-cvslog] CVS: main subreader.c,1.83,1.84 subreader.h,1.22,1.23
Arpi of Ize
arpi at mplayerhq.hu
Sat Dec 28 16:20:14 CET 2002
Update of /cvsroot/mplayer/main
In directory mail:/var/tmp.root/cvs-serv32067
Modified Files:
subreader.c subreader.h
Log Message:
This patch adds a call to subcp_recode1(), so this subtitles too are
processed through iconv().
Kresimir Kukulj madmax at iskon.hr
Index: subreader.c
===================================================================
RCS file: /cvsroot/mplayer/main/subreader.c,v
retrieving revision 1.83
retrieving revision 1.84
diff -u -r1.83 -r1.84
--- subreader.c 28 Dec 2002 13:42:24 -0000 1.83
+++ subreader.c 28 Dec 2002 15:19:34 -0000 1.84
@@ -964,6 +964,29 @@
return sub;
}
+// for demux_ogg.c:
+subtitle* subcp_recode1 (subtitle *sub)
+{
+ int l=sub->lines;
+ size_t ileft, oleft;
+ char *op, *ip;
+
+ while (l){
+ ip = icbuffer;
+ op = sub->text[--l];
+ strcpy(ip, op);
+ ileft = strlen(ip);
+ oleft = ICBUFFSIZE - 1;
+
+ if (iconv(icdsc, &ip, &ileft,
+ &op, &oleft) == (size_t)(-1)) {
+ mp_msg(MSGT_SUBREADER,MSGL_WARN,"SUB: error recoding line.\n");
+ return sub;
+ }
+ *op='\0' ;
+ }
+ return sub;
+}
#endif
static void adjust_subs_time(subtitle* sub, float subtime, float fps, int block){
Index: subreader.h
===================================================================
RCS file: /cvsroot/mplayer/main/subreader.h,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- subreader.h 14 Dec 2002 17:54:59 -0000 1.22
+++ subreader.h 28 Dec 2002 15:19:34 -0000 1.23
@@ -38,6 +38,7 @@
} subtitle;
subtitle* sub_read_file (char *filename, float pts);
+subtitle* subcp_recode1 (subtitle *sub);
char * sub_filename(char *path, char * fname);
void list_sub_file(subtitle* subs);
void dump_srt(subtitle* subs, float fps);
More information about the MPlayer-cvslog
mailing list