Mercurial > mplayer.hg
comparison libvo/sub.c @ 24292:ca146808e926
Proper support for flashing chars in teletext pages.
Patch from Otvos Attila oattila at chello dot hu
author | voroshil |
---|---|
date | Sat, 01 Sep 2007 01:22:30 +0000 |
parents | 7e2808fb1807 |
children | 09d402672398 |
comparison
equal
deleted
inserted
replaced
24291:1c14b18d6249 | 24292:ca146808e926 |
---|---|
268 bs+= srcskip; | 268 bs+= srcskip; |
269 } | 269 } |
270 } | 270 } |
271 inline static void vo_update_text_teletext(mp_osd_obj_t *obj, int dxs, int dys) | 271 inline static void vo_update_text_teletext(mp_osd_obj_t *obj, int dxs, int dys) |
272 { | 272 { |
273 int h=0,w=0,i,j,font; | 273 int h=0,w=0,i,j,font,flashon; |
274 int wm,hm; | 274 int wm,hm; |
275 int color; | 275 int color; |
276 int x,y,x0,y0; | 276 int x,y,x0,y0; |
277 int cols,rows; | 277 int cols,rows; |
278 int wm12; | 278 int wm12; |
288 obj->flags|=OSDFLAG_CHANGED|OSDFLAG_VISIBLE; | 288 obj->flags|=OSDFLAG_CHANGED|OSDFLAG_VISIBLE; |
289 if (!tdp || !vo_osd_teletext_mode) { | 289 if (!tdp || !vo_osd_teletext_mode) { |
290 obj->flags&=~OSDFLAG_VISIBLE; | 290 obj->flags&=~OSDFLAG_VISIBLE; |
291 return; | 291 return; |
292 } | 292 } |
293 flashon=(GetTimer()/1000000)%2; | |
293 switch(vo_osd_teletext_half){ | 294 switch(vo_osd_teletext_half){ |
294 case TT_ZOOM_TOP_HALF: | 295 case TT_ZOOM_TOP_HALF: |
295 start_row=0; | 296 start_row=0; |
296 max_rows=VBI_ROWS/2; | 297 max_rows=VBI_ROWS/2; |
297 break; | 298 break; |
402 y=y0; | 403 y=y0; |
403 for(i=0;i<rows;i++){ | 404 for(i=0;i<rows;i++){ |
404 x=x0; | 405 x=x0; |
405 for(j=0;j<cols;j++){ | 406 for(j=0;j<cols;j++){ |
406 tc=tdp[(i+start_row)*VBI_COLUMNS+j]; | 407 tc=tdp[(i+start_row)*VBI_COLUMNS+j]; |
407 if(!tc.gfx){ | 408 if(!tc.gfx || (tc.flh && !flashon)){ |
408 /* Rendering one text character */ | 409 /* Rendering one text character */ |
409 draw_alpha_buf(obj,x,y,wm,hm,buf[tc.bg],buf[8],wm); | 410 draw_alpha_buf(obj,x,y,wm,hm,buf[tc.bg],buf[8],wm); |
410 if(tc.unicode!=0x20 && tc.unicode!=0x00 && !tc.ctl && | 411 if(tc.unicode!=0x20 && tc.unicode!=0x00 && !tc.ctl && |
412 (!tc.flh || flashon) && | |
411 (font=vo_font->font[tc.unicode])>=0 && y+hm<dys){ | 413 (font=vo_font->font[tc.unicode])>=0 && y+hm<dys){ |
412 tt_draw_alpha_buf(obj,x,y,vo_font->width[tc.unicode],vo_font->height, | 414 tt_draw_alpha_buf(obj,x,y,vo_font->width[tc.unicode],vo_font->height, |
413 vo_font->pic_b[font]->bmp+vo_font->start[tc.unicode]-vo_font->charspace*vo_font->pic_a[font]->w, | 415 vo_font->pic_b[font]->bmp+vo_font->start[tc.unicode]-vo_font->charspace*vo_font->pic_a[font]->w, |
414 vo_font->pic_b[font]->w, | 416 vo_font->pic_b[font]->w, |
415 buf[tc.fg][0],buf[tc.bg][0],buf[8][0]); | 417 buf[tc.fg][0],buf[tc.bg][0],buf[8][0]); |