Re: vdr-ttxtsubs in vdr developer versions? SOLVED

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Magnus Andersson wrote:
> Rolf Ahrenberg wrote:
>   
>> I don't have any channels with teletext subtitles and haven't used the 
>> plugin for years. However, if someone is keen enough to make a real fix 
>> and send it to me, I can update my patches...
>>
>> BR,
>> --
>> rofa
>>
>>   
>>     
Big thanks to Jose Alberto who sent this patch with the following
instructions.

Magnus, I can't write to the list, I send to you my patches to make it work 
with UTF-8.

I do:

mv teletext-chars.h teletext-chars.h.sav
iconv -f ISO-8859-15 -t UTF-8 teletext-chars.h.sav > teletext-chars.h

and change in line 51 in teletext-chars.h:

uint8_t laG0_nat_opts[13][14] = {

for

uint16_t laG0_nat_opts[13][14] = {

and apply the attached patch.

Jose Alberto


diff -aur ttxtsubs-0.0.5/teletext.c ttxtsubs-0.0.5.coque/teletext.c
--- ttxtsubs-0.0.5/teletext.c	2007-06-29 16:24:31.000000000 +0200
+++ ttxtsubs-0.0.5.coque/teletext.c	2007-06-29 15:10:14.000000000 +0200
@@ -108,7 +108,7 @@
  * Also strips parity
  */
 
-uint8_t ttxt_laG0_la1_char(int Gtriplet, int natopts, uint8_t inchar)
+uint16_t ttxt_laG0_la1_char(int Gtriplet, int natopts, uint8_t inchar)
 {
   int no = laG0_nat_opts_lookup[Gtriplet & 0xf][natopts & 0x7];
   uint8_t c = inchar & 0x7f;
diff -aur ttxtsubs-0.0.5/teletext.h ttxtsubs-0.0.5.coque/teletext.h
--- ttxtsubs-0.0.5/teletext.h	2004-03-01 23:53:17.000000000 +0100
+++ ttxtsubs-0.0.5.coque/teletext.h	2007-06-29 15:21:59.000000000 +0200
@@ -80,7 +80,7 @@
  * inchar - 7 bits = characted to remap
  * Also strips parity
  */
-uint8_t ttxt_laG0_la1_char(int Gtriplet, int natopts, uint8_t inchar);
+uint16_t ttxt_laG0_la1_char(int Gtriplet, int natopts, uint8_t inchar);
 
 /*
  * Map Latin G2 teletext characters into a ISO-8859-1 approximation.
Sólo en ttxtsubs-0.0.5.coque: teletext.o
Sólo en ttxtsubs-0.0.5.coque: ttxtsubschannelsettings.o
diff -aur ttxtsubs-0.0.5/ttxtsubsdisplay.c ttxtsubs-0.0.5.coque/ttxtsubsdisplay.c
--- ttxtsubs-0.0.5/ttxtsubsdisplay.c	2007-06-29 16:24:31.000000000 +0200
+++ ttxtsubs-0.0.5.coque/ttxtsubsdisplay.c	2007-06-29 16:22:00.000000000 +0200
@@ -284,7 +284,10 @@
       continue;
 
     if(c >= 0x20) {
-      buf[j++] = ttxt_laG0_la1_char(0, natopts, c);
+      uint16_t aux = ttxt_laG0_la1_char(0, natopts, c);
+      if (aux & 0xff00)
+        buf[j++] = (aux & 0xff00) >> 8;
+      buf[j++] = aux & 0x00ff;
     }
   }
 
@@ -370,7 +373,7 @@
 {
   int i, y;
   int rowcount = 0;
-  char buf[TTXT_DISPLAYABLE_ROWS][41];
+  char buf[TTXT_DISPLAYABLE_ROWS][82];
   int bottom = globals.bottomAdj() + (globals.bottomLB() ? BOTLETTERBOX : BOTNORM);
   tArea areas[MAXOSDAREAS];
   int numAreas = 0;
@@ -412,7 +415,9 @@
        }
      }
 
+#if defined(APIVERSNUM) && APIVERSNUM < 10500
   cFont::SetCode(I18nCharSets()[globals.i18nLanguage()]);
+#endif
   if(rowcount > MAXTTXTROWS)
     rowcount = MAXTTXTROWS;
   y = bottom - SCREENTOP - ROWH - ((ROWINCR + globals.lineSpacing()) * (rowcount-1));
@@ -435,7 +440,9 @@
     y += (ROWINCR + globals.lineSpacing());
   }
   if (mOsd->CanHandleAreas(areas, numAreas) != oeOk) {
+#if defined(APIVERSNUM) && APIVERSNUM < 10500
      cFont::SetCode(I18nCharSets()[Setup.OSDLanguage]);
+#endif
      dprint("ttxtsubs: OSD Cannot handle areas (error code: %d) - try to enlarge the line spacing!\n", mOsd->CanHandleAreas(areas, numAreas));
      }
   else {
@@ -460,7 +467,9 @@
       //dprint("%d/%d (%d,%d) (%d,%d): %s\n", i, rowcount-1, areas[i].x1, areas[i].y1, left + TEXTX, y + TEXTY, buf[i]);
       y += (ROWINCR + globals.lineSpacing());
       }
+#if defined(APIVERSNUM) && APIVERSNUM < 10500
     cFont::SetCode(I18nCharSets()[Setup.OSDLanguage]);
+#endif
     mOsd->Flush();
     }
 }
_______________________________________________
vdr mailing list
vdr@xxxxxxxxxxx
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr

[Index of Archives]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Util Linux NG]     [Xfree86]     [Big List of Linux Books]     [Fedora Users]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux