diff options
author | Tobias Grimm <tobias@e-tobi.loc> | 2009-04-24 00:39:34 +0200 |
---|---|---|
committer | Tobias Grimm <tobias@e-tobi.loc> | 2009-06-20 17:40:07 +0200 |
commit | 656e4190a147f97978bf324107a4008c79a18fe0 (patch) | |
tree | 4b3878d22907e32b3d25a87c23a2d944295efc1e /pat.c | |
parent | 37f9027dd64cb2f96ad5b1f397aa2b5102bd07ac (diff) | |
download | vdr-patches-656e4190a147f97978bf324107a4008c79a18fe0.tar.gz vdr-patches-656e4190a147f97978bf324107a4008c79a18fe0.tar.bz2 |
ttxtsubs: Store subtitle teletext pages in channel data to be used by the cPatPmtGenerator
(provided by Rolf Ahrenberg)
Diffstat (limited to 'pat.c')
-rw-r--r-- | pat.c | 17 |
1 files changed, 16 insertions, 1 deletions
@@ -337,6 +337,9 @@ void cPatFilter::Process(u_short Pid, u_char Tid, const u_char *Data, int Length char DLangs[MAXDPIDS][MAXLANGCODE2] = { "" }; char SLangs[MAXSPIDS][MAXLANGCODE2] = { "" }; int Tpid = 0; + char TLangs[MAXTPAGES][MAXLANGCODE2] = { "" }; + int TPages[MAXTPAGES + 1] = { 0 }; + int NumTPages = 0; int NumApids = 0; int NumDpids = 0; int NumSpids = 0; @@ -414,8 +417,19 @@ void cPatFilter::Process(u_short Pid, u_char Tid, const u_char *Data, int Length NumSpids++; } break; - case SI::TeletextDescriptorTag: + case SI::TeletextDescriptorTag: { Tpid = stream.getPid(); + SI::TeletextDescriptor *sd = (SI::TeletextDescriptor *)d; + SI::TeletextDescriptor::Teletext ttxt; + for (SI::Loop::Iterator it; sd->teletextLoop.getNext(ttxt, it); ) { + if ((NumTPages < MAXTPAGES) && ttxt.languageCode[0] && ((ttxt.getTeletextType() == 0x02) || (ttxt.getTeletextType() == 0x05))) { + char *s = TLangs[NumTPages]; + strn0cpy(s, I18nNormalizeLanguageCode(ttxt.languageCode), MAXLANGCODE1); + TPages[NumTPages] = (ttxt.getTeletextPageNumber() & 0xff) | ((ttxt.getTeletextMagazineNumber() & 0xff) << 8) | ((ttxt.getTeletextType() & 0xff) << 16); + NumTPages++; + } + } + } break; case SI::ISO639LanguageDescriptorTag: { SI::ISO639LanguageDescriptor *ld = (SI::ISO639LanguageDescriptor *)d; @@ -444,6 +458,7 @@ void cPatFilter::Process(u_short Pid, u_char Tid, const u_char *Data, int Length } if (Setup.UpdateChannels >= 2) { Channel->SetPids(Vpid, Ppid, Vtype, Apids, ALangs, Dpids, DLangs, Spids, SLangs, Tpid); + Channel->SetTPidData(TLangs, TPages); Channel->SetCaIds(CaDescriptors->CaIds()); } Channel->SetCaDescriptors(CaDescriptorHandler.AddCaDescriptors(CaDescriptors)); |