Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

DVB: Improve encryption detection by only checking the CA encryption …

…bits for Audio and Video.

This prevents cases where some channels are mistakenly discarded as encrypted in DVB systems.  This should help to improve the accuracy of scans.

Patch from eallaud, minor cleanup and verification against the specs by me, secondary code review by Stuart A.  Thanks!

Fixes #8645.
  • Loading branch information...
commit 19a2cc7c3661675faa8f2025bf716ade8becda91 1 parent c0a27a6
Robert McNamara authored
View
4 mythtv/libs/libmythtv/channelscan/channelscan_sm.cpp
@@ -370,7 +370,7 @@ void ChannelScanSM::HandlePMT(uint, const ProgramMapTable *pmt)
QString("Got a Program Map Table for %1")
.arg((*current).FriendlyName) + "\n" + pmt->toString());
- if (!currentTestingDecryption && pmt->IsEncrypted())
+ if (!currentTestingDecryption && pmt->IsEncrypted(GetDTVChannel()->GetSIStandard()))
currentEncryptionStatus[pmt->ProgramNumber()] = kEncUnknown;
}
@@ -1184,7 +1184,7 @@ ChannelScanSM::GetChannelList(transport_scan_items_it_t trans_info,
info.is_opencable = true;
}
- info.is_encrypted |= pmt->IsEncrypted();
+ info.is_encrypted |= pmt->IsEncrypted(GetDTVChannel()->GetSIStandard());
info.in_pmt = true;
}
View
6 mythtv/libs/libmythtv/dtvsignalmonitor.cpp
@@ -329,8 +329,10 @@ void DTVSignalMonitor::HandlePMT(uint, const ProgramMapTable *pmt)
return; // Not the PMT we are looking for...
}
- if (pmt->IsEncrypted())
+ if (pmt->IsEncrypted(GetDTVChannel()->GetSIStandard())) {
+ VERBOSE(VB_IMPORTANT,QString("PMT says program %1 is encrypted").arg(programNumber));
GetStreamData()->TestDecryption(pmt);
+ }
// if PMT contains audio and/or video stream set as matching.
uint hasAudio = 0;
@@ -345,7 +347,7 @@ void DTVSignalMonitor::HandlePMT(uint, const ProgramMapTable *pmt)
if ((hasVideo >= GetStreamData()->GetVideoStreamsRequired()) &&
(hasAudio >= GetStreamData()->GetAudioStreamsRequired()))
{
- if (pmt->IsEncrypted() && !ignore_encrypted)
+ if (pmt->IsEncrypted(GetDTVChannel()->GetSIStandard()) && !ignore_encrypted)
AddFlags(kDTVSigMon_WaitForCrypt);
AddFlags(kDTVSigMon_PMTMatch);
View
13 mythtv/libs/libmythtv/mpeg/mpegtables.cpp
@@ -467,15 +467,18 @@ bool ProgramMapTable::IsAudio(uint i, QString sistandard) const
return StreamID::IsAudio(stream_id);
}
-/** \fn ProgramMapTable::IsEncrypted(void) const
- * \brief Returns true iff PMT contains CA descriptor.
+/** \fn ProgramMapTable::IsEncrypted(QString sistandard) const
+ * \brief Returns true iff PMT contains CA descriptor for a vid/aud stream.
*/
-bool ProgramMapTable::IsEncrypted(void) const
+bool ProgramMapTable::IsEncrypted(QString sistandard) const
{
bool encrypted = IsProgramEncrypted();
- for (uint i = 0; !encrypted && i < StreamCount(); i++)
- encrypted |= IsStreamEncrypted(i);
+ for (uint i = 0; !encrypted && i < StreamCount(); i++) {
+ /* Only check audio/video streams */
+ if (IsAudio(i,sistandard) || IsVideo(i,sistandard))
+ encrypted |= IsStreamEncrypted(i);
+ }
return encrypted;
}
View
2  mythtv/libs/libmythtv/mpeg/mpegtables.h
@@ -605,7 +605,7 @@ class ProgramMapTable : public PSIPTable
// helper methods
bool IsVideo(uint i, QString sistandard) const;
bool IsAudio(uint i, QString sistandard) const;
- bool IsEncrypted(void) const;
+ bool IsEncrypted(QString sistandard) const;
bool IsProgramEncrypted(void) const;
bool IsStreamEncrypted(uint pid) const;
/// Returns true iff PMT contains a still-picture video stream
Please sign in to comment.
Something went wrong with that request. Please try again.