diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2015-01-04 13:36:46 +0100 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2015-01-04 13:36:46 +0100 |
commit | afc17c1168f4eae489d0f728568898f07e72aeea (patch) | |
tree | df8dd8aba1cb2b9d04f7a30a68af7b29a4f2dbf3 /pat.c | |
parent | bfdd611fde17ee57bd90cbefa4c3c4f731f613bc (diff) | |
download | vdr-afc17c1168f4eae489d0f728568898f07e72aeea.tar.gz vdr-afc17c1168f4eae489d0f728568898f07e72aeea.tar.bz2 |
The pid of the PMT in which the CA descriptors of a given channel are broadcast is now stored together with the CA descriptors
Diffstat (limited to 'pat.c')
-rw-r--r-- | pat.c | 27 |
1 files changed, 23 insertions, 4 deletions
@@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: pat.c 3.4 2014/02/19 08:57:43 kls Exp $ + * $Id: pat.c 3.5 2015/01/04 13:14:01 kls Exp $ */ #include "pat.h" @@ -69,12 +69,13 @@ private: int source; int transponder; int serviceId; + int pmtPid; // needed for OctopusNet - otherwise irrelevant! int numCaIds; int caIds[MAXCAIDS + 1]; cList<cCaDescriptor> caDescriptors; void AddCaId(int CaId); public: - cCaDescriptors(int Source, int Transponder, int ServiceId); + cCaDescriptors(int Source, int Transponder, int ServiceId, int PmtPid); bool operator== (const cCaDescriptors &arg) const; bool Is(int Source, int Transponder, int ServiceId); bool Is(cCaDescriptors * CaDescriptors); @@ -82,14 +83,16 @@ public: void AddCaDescriptor(SI::CaDescriptor *d, int EsPid); int GetCaDescriptors(const int *CaSystemIds, int BufSize, uchar *Data, int EsPid); int GetCaPids(const int *CaSystemIds, int BufSize, int *Pids); + const int GetPmtPid(void) { return pmtPid; }; const int *CaIds(void) { return caIds; } }; -cCaDescriptors::cCaDescriptors(int Source, int Transponder, int ServiceId) +cCaDescriptors::cCaDescriptors(int Source, int Transponder, int ServiceId, int PmtPid) { source = Source; transponder = Transponder; serviceId = ServiceId; + pmtPid = PmtPid; numCaIds = 0; caIds[0] = 0; } @@ -218,6 +221,7 @@ public: // and 2 if an existing descriptor was changed. int GetCaDescriptors(int Source, int Transponder, int ServiceId, const int *CaSystemIds, int BufSize, uchar *Data, int EsPid); int GetCaPids(int Source, int Transponder, int ServiceId, const int *CaSystemIds, int BufSize, int *Pids); + int GetPmtPid(int Source, int Transponder, int ServiceId); }; int cCaDescriptorHandler::AddCaDescriptors(cCaDescriptors *CaDescriptors) @@ -258,6 +262,16 @@ int cCaDescriptorHandler::GetCaPids(int Source, int Transponder, int ServiceId, return 0; } +int cCaDescriptorHandler::GetPmtPid(int Source, int Transponder, int ServiceId) +{ + cMutexLock MutexLock(&mutex); + for (cCaDescriptors *ca = First(); ca; ca = Next(ca)) { + if (ca->Is(Source, Transponder, ServiceId)) + return ca->GetPmtPid(); + } + return 0; +} + cCaDescriptorHandler CaDescriptorHandler; int GetCaDescriptors(int Source, int Transponder, int ServiceId, const int *CaSystemIds, int BufSize, uchar *Data, int EsPid) @@ -270,6 +284,11 @@ int GetCaPids(int Source, int Transponder, int ServiceId, const int *CaSystemIds return CaDescriptorHandler.GetCaPids(Source, Transponder, ServiceId, CaSystemIds, BufSize, Pids); } +int GetPmtPid(int Source, int Transponder, int ServiceId) +{ + return CaDescriptorHandler.GetPmtPid(Source, Transponder, ServiceId); +} + // --- cPatFilter ------------------------------------------------------------ //#define DEBUG_PAT_PMT @@ -384,7 +403,7 @@ void cPatFilter::Process(u_short Pid, u_char Tid, const u_char *Data, int Length cChannel *Channel = Channels.GetByServiceID(Source(), Transponder(), pmt.getServiceId()); if (Channel) { SI::CaDescriptor *d; - cCaDescriptors *CaDescriptors = new cCaDescriptors(Channel->Source(), Channel->Transponder(), Channel->Sid()); + cCaDescriptors *CaDescriptors = new cCaDescriptors(Channel->Source(), Channel->Transponder(), Channel->Sid(), Pid); // Scan the common loop: for (SI::Loop::Iterator it; (d = (SI::CaDescriptor*)pmt.commonDescriptors.getNext(it, SI::CaDescriptorTag)); ) { CaDescriptors->AddCaDescriptor(d, 0); |