From patchwork Fri Jun 29 19:35:08 2007 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Magnus Andersson X-Patchwork-Id: 12483 Received: from mxf2.bahnhof.se ([213.80.101.26]) by www.linuxtv.org with esmtp (Exim 4.63) (envelope-from ) id 1I4MFL-0007jS-D6 for vdr@linuxtv.org; Fri, 29 Jun 2007 21:35:11 +0200 Received: from localhost (mxf2.local [127.0.0.1]) by mxf2-reinject (Postfix) with ESMTP id 044CE6BD039 for ; Fri, 29 Jun 2007 21:35:10 +0200 (CEST) X-Virus-Scanned: by amavisd-new using ClamAV at bahnhof.se (MXF2) X-Spam-Score: 1.57 X-Spam-Level: * X-Spam-Status: No, score=1.57 tagged_above=-99 required=5 tests=[AWL=0.177, BAYES_00=-2.599, RCVD_IN_NJABL_DUL=1.946, RCVD_IN_SORBS_DUL=2.046] Received: from mxf2.bahnhof.se ([127.0.0.1]) by localhost (mxf2.bahnhof.se [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id qrQoot2BPAnn for ; Fri, 29 Jun 2007 21:35:08 +0200 (CEST) Received: from [192.168.2.10] (h-149-137.A163.cust.bahnhof.se [81.170.149.137]) by mxf2.bahnhof.se (Postfix) with ESMTP id 93E716BD110 for ; Fri, 29 Jun 2007 21:35:08 +0200 (CEST) Message-ID: <46855EEC.7050507@bahnhof.se> Date: Fri, 29 Jun 2007 21:35:08 +0200 From: Magnus Andersson User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.1.4) Gecko/20070603 SeaMonkey/1.1.2 MIME-Version: 1.0 To: VDR Mailing List References: <4682B3C8.5010306@bahnhof.se> <4682BB7C.1030202@ventoso.org> <4683FEF3.4000005@bahnhof.se> In-Reply-To: <4683FEF3.4000005@bahnhof.se> Subject: Re: [vdr] vdr-ttxtsubs in vdr developer versions? SOLVED X-BeenThere: vdr@linuxtv.org X-Mailman-Version: 2.1.9 Precedence: list Reply-To: VDR Mailing List List-Id: VDR Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2007 19:35:11 -0000 Status: O X-Status: X-Keywords: X-UID: 13397 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(); } }