summaryrefslogtreecommitdiffstats
path: root/stream
diff options
context:
space:
mode:
authorvoroshil <voroshil@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-08-29 17:28:41 +0000
committervoroshil <voroshil@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-08-29 17:28:41 +0000
commit5b673bf021f599e0798fa2e60853208bd72d576f (patch)
tree1da8b80a932321e5d3df28bbd527657d6afa7bd1 /stream
parentc0831f3400d3a2f21f2ac7b013ac3515b45950d8 (diff)
downloadmpv-5b673bf021f599e0798fa2e60853208bd72d576f.tar.bz2
mpv-5b673bf021f599e0798fa2e60853208bd72d576f.tar.xz
Implement Flash/Steady (swapping foreground/background colors)
and Conceal (filling following chars with spaces) control characters. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24295 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'stream')
-rw-r--r--stream/tvi_vbi.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/stream/tvi_vbi.c b/stream/tvi_vbi.c
index 423d1ed23c..f89550e2e3 100644
--- a/stream/tvi_vbi.c
+++ b/stream/tvi_vbi.c
@@ -572,6 +572,7 @@ static void decode_page(tt_char* p,int lang,unsigned char* raw)
int bg_color=0;
int row,col;
int separated=0;
+ int conceal;
for(row=0;row<VBI_ROWS;row++) {
lat=(lang==0);
@@ -579,6 +580,7 @@ static void decode_page(tt_char* p,int lang,unsigned char* raw)
fg_color=7;
bg_color=0;
separated=0;
+ conceal=0;
for(col=0;col<VBI_COLUMNS;col++){
i=row*VBI_COLUMNS+col;
c=raw[i];
@@ -592,13 +594,24 @@ static void decode_page(tt_char* p,int lang,unsigned char* raw)
p[i].ctl=(c&0x60)==0?1:0;
p[i].fg=fg_color;
p[i].bg=bg_color;
-
+
if ((c&0x60)==0){ //control chars
- if(c>=0x08 && c<=0x0f){
+ if(c>=0x08 && c<=0x09){//Flash/Steady
+ int tmp;
+ tmp=bg_color;
+ bg_color=fg_color;
+ fg_color=tmp;
+ if(c==0x09){
+ p[i].fg=fg_color;
+ p[i].bg=bg_color;
+ }
+ }else if(c>=0x0a && c<=0x0f){
}else if (c<=0x17){ //colors
fg_color=c&0x0f;
gfx=c>>4;
+ conceal=0;
}else if (c<=0x18){
+ conceal=1;
}else if (c<=0x1a){ //Contiguous/Separated gfx
separated=!(c&1);
}else if (c<=0x1b){
@@ -612,7 +625,10 @@ static void decode_page(tt_char* p,int lang,unsigned char* raw)
continue;
}
- if(gfx){
+ if(conceal){
+ p[i].gfx=0;
+ p[i].unicode=' ';
+ }else if(gfx){
p[i].unicode=c-0x20;
if (p[i].unicode>0x3f) p[i].unicode-=0x20;
}else