Skip to content

Commit 74447fb

Browse files
committed
[cahandler] Fix wrong offsets in buildCAPMT(eDVBService) after Protocol-3 header
The 5-byte Protocol-3 header (0xA5 + 4-byte msgid) was added to m_capmt but the offsets for the length field and programInfoLength in buildCAPMT(eDVBService) were not adjusted accordingly. - capmt length: offset 3 -> 8 (position 3 + 5-byte header) - programInfoLength: offset 8/9 -> 13/14 (position 8/9 + 5-byte header) This function is used when the dxIsScrambledPMT flag (f:400 in lamedb) is manually set on a service. This flag tells enigma2 that the PMT itself is encrypted and needs to be descrambled before it can be parsed. When set, eDVBServicePMTHandler::handlePMT() calls buildCAPMT(eDVBService) to create a CAPMT from cached service data (PIDs, CAIDs) instead of from a live PMT. Without this fix, services with f:400 would send malformed CAPMT packets to the CA handler breaking descrambling. [cahandler] Remove PMT PID as ES element from buildCAPMT(eDVBService) The cached PMT PID was being appended as an Elementary Stream element with StreamType 0x0d (DSM CC) in the CAPMT built from cached service data. This is wrong - the PMT PID is not a descramblable stream. The same issue was already fixed in buildCAPMT(eTable*) by commit caa72ff, but the pidtype map in buildCAPMT(eDVBService) was overlooked. The PMT PID is already correctly included as descriptor 0x84 in the program info section. This only affects non-standard services using the cached PMT path.
1 parent c14abba commit 74447fb

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

lib/dvb/cahandler.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1091,7 +1091,6 @@ int eDVBCAService::buildCAPMT(ePtr<eDVBService> &dvbservice)
10911091
pidtype[eDVBService::cDDPPID] = 0x06;
10921092
pidtype[eDVBService::cAACAPID] = 0x06;
10931093
pidtype[eDVBService::cDATAPID] = 0x90; // Datastream (Blu-ray subtitling)
1094-
pidtype[eDVBService::cPMTPID] = 0x0d; // Datastream (DSM CC)
10951094

10961095
// cached pids
10971096
for (int x = 0; x < eDVBService::cacheMax; ++x)
@@ -1117,12 +1116,12 @@ int eDVBCAService::buildCAPMT(ePtr<eDVBService> &dvbservice)
11171116
}
11181117
}
11191118

1120-
// calculate capmt length
1121-
m_capmt[3] = pos - 9;
1119+
// calculate capmt length (offset 8 = position 3 after 5-byte protocol header)
1120+
m_capmt[8] = pos - 9;
11221121

1123-
// calculate programinfo leght
1124-
m_capmt[8] = programInfoLength>>8;
1125-
m_capmt[9] = programInfoLength&0xFF;
1122+
// calculate programinfo length (offset 13/14 = position 8/9 after 5-byte protocol header)
1123+
m_capmt[13] = programInfoLength>>8;
1124+
m_capmt[14] = programInfoLength&0xFF;
11261125

11271126
m_prev_build_hash = build_hash;
11281127
m_version = pmt_version;

0 commit comments

Comments
 (0)