mplayer를 실행하면 좌측 상단에 시간이 표시되는데, 이게 화면을 가려서
눈에 거슬리네요.
어떡하면 이걸 지울 수 있나요?
글구, 자막 기능 참 좋은 것 같습니다.
저는 10pt짜리 small font를 쓰는데(hsfont라는 거 받았습니다.)
그런데, 라인이 길면 앞뒤로 글자가 짤려 버리더군요.
그래서 짤리지 않게, 길어지면 적당히 줄을 나누도록 subreader.c 파일을
수정해 보았습니다.
---------- subreader.c 파일에서 수정한 부분 ------------------
subtitle *sub_read_line_sami(FILE *fd, subtitle *current) {
static char line[1001];
static char *s = NULL;
char text[1000], *p, *q;
int state;<font color=red>
int iChrCnt; /* added by jdy 2001.05.08 */
int iHan = 0; /* added by jdy 2001.05.08 */</font>
current->lines = current->start = current->end = 0;
state = 0;
/* read the first line */
if (!s)
if (!(s = fgets(line, 1000, fd))) return 0;
do {
switch (state) {
case 0: /* find "START=" */
s = strstr (s, "Start=");
if (s) {
current->start = strtol (s + 6, &s, 0) / 10;
state = 1; continue;
}
break;
case 1: /* find "<P" */
if ((s = strstr (s, "<P"))) { s += 2; state = 2; continue; }
break;
case 2: /* find ">" */
if ((s = strchr (s, '>'))) { s++; state = 3; p = text; continue; }
break;
case 3: /* get all text until '<' appears */
if (*s == ' ') { break; }
<font color=red>/* added by jdy 2001.05.08 */
else if (!strncasecmp (s, "<br>", 4)) {
*p = ' '; p = text; trail_space (text);
if (text[0] != ' ')
current->text[current->lines++] = strdup (text);
s += 4;
iChrCnt = 0; /* added by jdy 2001.05.08 */
}</font>
else if (*s == '<') {
state = 4;<font color=red>
iChr
Cnt = 0; /* added by jdy 2001.05.08 */</font>
}
else if (!strncasecmp (s, " ",
6)) {
*p++ = ' '; s += 6;
<font color=red>/* added by jdy 2001.05.08
*/
iChrCnt++;
if (iChrCnt >= 45) {
*(p-1)
= ' '; p = text; trail_space (text);
if (text[0] != ' ')
current->text[current->lines++] = strdup (text);
iChrCnt = 0;
}</font>
}
else if (*s == '
') {
s++;<font color=red>
iChrCnt++; /* 'iChrCnt' : added by jdy 2001.05.08 */
</font>
}<fon
t color=blue>
/* comment out by jdy 2001.05.08
else if (!strncasecmp (s, "<br>", 4)
|| *s == '') {
*p = ' '; p = text; trail_space (text);
if (text[0] != '
')
current->text[current->lines++] = strdup (text);
if (*s == '')
s++; else s += 4;
}
*/</font><font color=red>
/* added by jdy 2001
.05.08 */
else if (*s == '') {
*p = ' '; p = text; trail_space (text);
if (text[0] != ' ')
current->text[current->lines++] = strdup (text);
s++;
iChrCnt = 0; /* added by jdy 2001.05.08 */
}</font>
else {<font color=red>
/* added by jdy 2001.05.08 :
* If the first bye of hangul, iHan = 1.
* the second byte, iHan = 2.
* english, iHan = 0.
*/
if
(*s & 0x80) iHan = iHan%2 + 1;
else iHan = 0;</font>
*p
++ = *s++;
<font color=red>
/* added by jdy 2001.05.08 */
iChrCnt++;
if (iChrCnt >= 45) {
if (iHan == 1) continu
e;
*p = ' '; p = text; trail_space (text);
if (text[0] != '
')
current->text[current->lines++] = strdup (text);
i
ChrCnt = 0;
}</font>
}
continue;
case 4: /* get
current->end or skip <TAG> */
q = strstr (s, "Start=");
if (q) {
current->end = strtol (q + 6, &q, 0) / 10 - 1;
*p = ' '; trail_space (text);
if (text[0] != ' ')
current->text[current->lines++] = strdup (text);
if (current->lines > 0) { state = 99; break; }
state = 0; continue;
}
s = strchr (s, '>');
if (s) { s++; state = 3; continue; }
break;
}
/* read next line */
if (state != 99 && !(s = fgets (line, 1000, fd))) ret
urn 0;
<font color=red>/* added by jdy 2001.05.08 */
iChrCnt = 0;</font>
} while
(state != 99);
return current;
}