Mercurial > mplayer.hg
comparison libvo/sub.c @ 10263:0df8816f4665
TiVo demuxer and sub-cc/osd decoder
patch by usenet@wingert.org
(http://tivo-mplayer.sourceforge.net/releases/MPlayer-20030501-tivo-patch.gz)
changes by me:
- spit demux_ty to demux_ty and demux_ty_osd (later handles mpeg user-data
decoding, ie sub-cc and osd)
- removed some cosmetics changes
- some compile fixes (gcc3 specific variable decl etc)
author | arpi |
---|---|
date | Mon, 09 Jun 2003 00:24:49 +0000 |
parents | bf3d4483bba1 |
children | c36db88bfbc4 |
comparison
equal
deleted
inserted
replaced
10262:e6f5487b2042 | 10263:0df8816f4665 |
---|---|
40 int sub_width_p=100; | 40 int sub_width_p=100; |
41 int sub_alignment=0; /* 0=top, 1=center, 2=bottom */ | 41 int sub_alignment=0; /* 0=top, 1=center, 2=bottom */ |
42 int sub_visibility=1; | 42 int sub_visibility=1; |
43 int sub_bg_color=0; /* subtitles background color */ | 43 int sub_bg_color=0; /* subtitles background color */ |
44 int sub_bg_alpha=0; | 44 int sub_bg_alpha=0; |
45 int sub_justify=0; | |
45 | 46 |
46 // return the real height of a char: | 47 // return the real height of a char: |
47 static inline int get_height(int c,int h){ | 48 static inline int get_height(int c,int h){ |
48 int font; | 49 int font; |
49 if ((font=vo_font->font[c])>=0) | 50 if ((font=vo_font->font[c])>=0) |
447 obj->y = dys - h; | 448 obj->y = dys - h; |
448 | 449 |
449 obj->bbox.y2 = obj->y + h; | 450 obj->bbox.y2 = obj->y + h; |
450 | 451 |
451 // calculate bbox: | 452 // calculate bbox: |
453 if (sub_justify) xmin = 10; | |
452 obj->bbox.x1=xmin; | 454 obj->bbox.x1=xmin; |
453 obj->bbox.x2=xmax; | 455 obj->bbox.x2=xmax; |
454 obj->bbox.y1=obj->y; | 456 obj->bbox.y1=obj->y; |
455 // obj->bbox.y2=obj->y+obj->params.subtitle.lines*vo_font->height; | 457 // obj->bbox.y2=obj->y+obj->params.subtitle.lines*vo_font->height; |
456 obj->flags|=OSDFLAG_BBOX; | 458 obj->flags|=OSDFLAG_BBOX; |
460 y = obj->y; | 462 y = obj->y; |
461 | 463 |
462 i=j=0; | 464 i=j=0; |
463 if ((l=obj->params.subtitle.lines)) for (;;) { | 465 if ((l=obj->params.subtitle.lines)) for (;;) { |
464 x=obj->params.subtitle.xtbl[i++]; | 466 x=obj->params.subtitle.xtbl[i++]; |
467 if (sub_justify) x = 10; | |
465 prevc = -1; | 468 prevc = -1; |
466 while ((c=obj->params.subtitle.utbl[j++])){ | 469 while ((c=obj->params.subtitle.utbl[j++])){ |
467 x += kerning(vo_font,prevc,c); | 470 x += kerning(vo_font,prevc,c); |
468 if ((font=vo_font->font[c])>=0) | 471 if ((font=vo_font->font[c])>=0) |
469 draw_alpha_buf(obj,x,y, | 472 draw_alpha_buf(obj,x,y, |