From 182cd78af06cee95594307b792b8951153c4888e Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sun, 4 Nov 2007 18:00:00 +0100 Subject: =?UTF-8?q?Version=201.5.11=20-=20Fixed=20checking=20compatibility?= =?UTF-8?q?=20mode=20for=20old=20subtitles=20plugin=20(thanks=20to=20Marco?= =?UTF-8?q?=20=20=20Schl=C3=BC=C3=9Fler).=20-=20Updated=20the=20French=20O?= =?UTF-8?q?SD=20texts=20(thanks=20to=20Michael=20Nival).=20-=20Updated=20t?= =?UTF-8?q?he=20Estonian=20OSD=20texts=20(thanks=20to=20Arthur=20Konovalov?= =?UTF-8?q?).=20-=20Updated=20the=20Italian=20OSD=20texts=20(thanks=20to?= =?UTF-8?q?=20Diego=20Pierotto).=20-=20The=20"Play"=20key=20now=20starts?= =?UTF-8?q?=20replay=20of=20the=20selected=20recording=20in=20the=20Record?= =?UTF-8?q?ings=20=20=20menu=20(thanks=20to=20Ville=20Skytt=C3=A4);=20-=20?= =?UTF-8?q?Improved=20shutdown=20handling=20(thanks=20to=20Udo=20Richter).?= =?UTF-8?q?=20-=20Housekeeping=20now=20waits=20for=20a=20while=20after=20a?= =?UTF-8?q?=20replay=20has=20ended=20(thanks=20to=20Udo=20Richter).=20-=20?= =?UTF-8?q?Added=20more=20special=20characters=20to=20the=20list=20of=20al?= =?UTF-8?q?lowed=20characters=20when=20entering=20=20=20strings=20(thanks?= =?UTF-8?q?=20to=20Thomas=20G=C3=BCnther).=20-=20Added=20Ukrainian=20langu?= =?UTF-8?q?age=20texts=20(thanks=20to=20Yarema=20Aka=20Knedlyk).=20-=20Add?= =?UTF-8?q?ed=20a=20workaround=20for=20recovering=20from=20wrongfully=20in?= =?UTF-8?q?terpreted=20"pre=201.3.19=20PS1=20packets".=20-=20Fixed=20a=20p?= =?UTF-8?q?ossible=20blocking=20in=20replay=20when=20subtitles=20are=20act?= =?UTF-8?q?ive.=20-=20Fixed=20displaying=20subtitles=20in=20live=20mode.?= =?UTF-8?q?=20-=20Fixed=20handling=20CONFDIR=20(thanks=20to=20Rolf=20Ahren?= =?UTF-8?q?berg).=20-=20Added=20some=20missing=20'const'=20keywords=20(tha?= =?UTF-8?q?nks=20to=20Sascha=20Volkenandt).=20-=20The=20'Allowed'=20parame?= =?UTF-8?q?ter=20in=20cMenuEditStrItem()=20is=20now=20NULL=20by=20default,?= =?UTF-8?q?=20which=20results=20=20=20in=20using=20tr(FileNameChars)=20(su?= =?UTF-8?q?ggested=20by=20Thomas=20G=C3=BCnther).=20-=20Added=20a=20missin?= =?UTF-8?q?g=20'.'=20to=20the=20date=20returned=20by=20DayDateTime()=20(th?= =?UTF-8?q?anks=20to=20Lauri=20Nurmi).=20-=20Improved=20the=20'i18n'=20tar?= =?UTF-8?q?get=20in=20the=20Makefile=20to=20avoid=20unnecessary=20work=20(?= =?UTF-8?q?thanks=20to=20=20=20Stefan=20Huelswitt).=20The=20'newplugin'=20?= =?UTF-8?q?and=20'i18n-to-gettext.pl'=20scripts=20have=20been=20=20=20chan?= =?UTF-8?q?ged=20accordingly.=20Plugin=20authors=20may=20want=20to=20adjus?= =?UTF-8?q?t=20the=20'i18n'=20target=20=20=20of=20their=20Makefiles.=20-?= =?UTF-8?q?=20Fixed=20a=20crash=20if=20no=20fonts=20are=20found=20(thanks?= =?UTF-8?q?=20to=20Mario=20Ivankovits=20and=20Clemens=20=20=20Kirchgattere?= =?UTF-8?q?r).=20-=20Fixed=20decoding=20filename=20characters=20in=20case?= =?UTF-8?q?=20there=20are=20not=20two=20hex=20digits=20after=20=20=20the?= =?UTF-8?q?=20'#'=20(reported=20by=20Helmut=20Auer).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dvbsubtitle.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'dvbsubtitle.c') diff --git a/dvbsubtitle.c b/dvbsubtitle.c index 1f7e6b7..e845594 100644 --- a/dvbsubtitle.c +++ b/dvbsubtitle.c @@ -7,7 +7,7 @@ * Original author: Marco Schlüßler * With some input from the "subtitle plugin" by Pekka Virtanen * - * $Id: dvbsubtitle.c 1.1 2007/10/14 14:02:35 kls Exp $ + * $Id: dvbsubtitle.c 1.2 2007/11/03 14:36:07 kls Exp $ */ #include "dvbsubtitle.h" @@ -692,7 +692,7 @@ int cDvbSubtitleConverter::Convert(const uchar *Data, int Length) bool ResetSubtitleAssembler = Data[PayloadOffset + 3] == 0x00; // Compatibility mode for old subtitles plugin: - if ((Data[PayloadOffset - 3] & 0x81) == 1 && Data[PayloadOffset - 2] == 0x81) { + if ((Data[7] & 0x01) && (Data[PayloadOffset - 3] & 0x81) == 0x01 && Data[PayloadOffset - 2] == 0x81) { PayloadOffset--; SubstreamHeaderLength = 1; ResetSubtitleAssembler = Data[8] >= 5; @@ -730,8 +730,8 @@ int cDvbSubtitleConverter::Convert(const uchar *Data, int Length) break; } } - return Length; } + return Length; } return 0; } @@ -767,7 +767,7 @@ void cDvbSubtitleConverter::Action(void) //TODO sync on PTS? are there actually devices that don't deliver an STC? } Delta /= 90; // STC and PTS are in 1/90000s - if (abs(Delta) <= MAXDELTA) { + if (Delta <= MAXDELTA) { if (Delta <= 0) { dbgconverter("Got %d bitmaps, showing #%d\n", bitmaps->Count(), sb->Index() + 1); if (AssertOsd()) { @@ -777,8 +777,8 @@ void cDvbSubtitleConverter::Action(void) } bitmaps->Del(sb); } - else - WaitMs = min(max(Delta, int64_t(0)), int64_t(1000)); + else if (Delta < WaitMs) + WaitMs = Delta; } else bitmaps->Del(sb); @@ -830,6 +830,8 @@ int cDvbSubtitleConverter::ExtractSegment(const uchar *Data, int Length, int64_t pages->Add(page); dbgpages("Create SubtitlePage %d (total pages = %d)\n", pageId, pages->Count()); } + if (Pts) + page->SetPts(Pts); switch (segmentType) { case PAGE_COMPOSITION_SEGMENT: { dbgsegments("PAGE_COMPOSITION_SEGMENT\n"); @@ -837,8 +839,6 @@ int cDvbSubtitleConverter::ExtractSegment(const uchar *Data, int Length, int64_t if (pageVersion == page->Version()) break; // no update page->SetVersion(pageVersion); - if (Pts) - page->SetPts(Pts); page->SetTimeout(Data[6]); page->SetState((Data[6 + 1] & 0x0C) >> 2); page->regions.Clear(); @@ -968,6 +968,7 @@ int cDvbSubtitleConverter::ExtractSegment(const uchar *Data, int Length, int64_t dbgsegments("END_OF_DISPLAY_SET_SEGMENT\n"); FinishPage(page); } + break; default: dbgsegments("*** unknown segment type: %02X\n", segmentType); } -- cgit v1.2.3