>> Read No. 1265 article  
영문자 오 (냉무)

등록 2001-05-10 10:57:00     조회 4
이름 돌쇠    

		: 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 (t
ext);
:                 s += 4;
:                 iChrCnt = 0; /* added by jdy 2001.05.08 */
:      
       }</font>
:             else if (*s == '<') { 
:                 state = 4;<font color=red>
:  
               iChrCnt = 0; /* added by jdy 2001.05.08 */</font>
:             }
:             else i
f (!strncasecmp (s, "&nbsp;", 6)) { 
:                 *p++ = ' '; s += 6; 
: 
:                 <font c
olor=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>
:             }<font color=blue>
:             /* comment out by jdy 200
1.05.08
:             else if (!strncasecmp (s, "<br>", 4) || *s == '') {
:                 *p = ''; p = 
text; trail_space (text);
:                 if (text[0] != '')
:                     current->text[cu
rrent->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 {<f
ont 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 & 0x8
0) 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) co
ntinue;
: 
:                     *p = ''; p = text; trail_space (text);
:                     if (t
ext[0] != '')
:                         current->text[current->lines++] = strdup (text);
:           
          iChrCnt = 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))) return 0;
:      
:         <font color=red>/* added by jdy
 2001.05.08 */
:         iChrCnt = 0;</font>
: 
:     } while (state != 99);
: 
:     return current;
: }--착
하게살자
이름
암호


>> 관련글
1265 영문자 오 (냉무)  돌쇠  2001.05.10  ....
  답장 RE: mplayer에서 영화 자막보기  mplayer  2001.05.06  ....
  목록보기 윗글 아랫글
글쓰기
답장쓰기 수정 삭제
정규표현식 [ 상세 검색 ]
페이지로딩: [ 0.72 초 ] 작업시간: [ 0.1 초 ]

Copyleft 1999-2026 by JSBoard Open Project
Theme Designed by IDOO All right reserved
[TOP]

적수네 동네
+
| 적수네 동네
| 공부방
| 리눅스 잡지 서고
| LSN 소스
| 링크 모음
+---+
게시판
+
| 떠들어보세!
| 질문과 답변
| 새소식과 정보
| 1원짜리 팁?
| 대화방
+---+
칼럼?
+
| 세하 훔쳐보기
| Welcome2nite
| 혜진의 염장판
+---+
리눅스 상표권
+
| 반대 서명란
| 토론 게시판
+---+
GNU
+
| GNU 선언문
| GNU GPL
| GNU 미러 목록
+---+
프로젝트?
+
| 리눅스카운터
| RC5DES
| 실질헌법 제작
+---+
커널 소식
+
| 안정 버젼: 2.4.14
+---+
테마 선택
+
LSN 방송국?
+
| OFF AIR
+---+
회원
+
| 로그인
+---+
[ 적수네 동네 ] [ 리눅스 상표권 독점 반대 ] [ 한글 리눅스 문서 프로젝트 ] [ KrLine ] [ 사랑넷 ] [ Valid HTML 4.0! ] [ SlashDot ] [ Freshmeat ]
Copyleft (C) 1998-2001 Byeong-Chan Kim . License
TIME: 1791069194
System by WYZsoft, HDD by I.O.Linux, Mizi Research, Embryo, WOWLINUX, Domain by SarangNet, Network by KrLine.