From 93f2d2b52ffcab1d20b220a9cfa3420fec5483f2 Mon Sep 17 00:00:00 2001 From: "Shinck@web.de" Date: Tue, 26 Feb 2013 21:57:28 +0000 Subject: [PATCH] Don't use the CAM when on an unencrypted channel or when just looking for EIT data Refs #11021 Signed-off-by: Stuart Auchterlonie --- mythtv/libs/libmythtv/recorders/dtvsignalmonitor.cpp | 10 ++++++++++ mythtv/libs/libmythtv/recorders/dtvsignalmonitor.h | 2 ++ mythtv/libs/libmythtv/recorders/dvbchannel.cpp | 6 +++--- mythtv/libs/libmythtv/recorders/dvbrecorder.cpp | 3 ++- mythtv/libs/libmythtv/recorders/dvbsignalmonitor.cpp | 8 -------- 5 files changed, 17 insertions(+), 12 deletions(-) diff --git a/mythtv/libs/libmythtv/recorders/dtvsignalmonitor.cpp b/mythtv/libs/libmythtv/recorders/dtvsignalmonitor.cpp index 3aeb16d3dde..6e6fd10176f 100644 --- a/mythtv/libs/libmythtv/recorders/dtvsignalmonitor.cpp +++ b/mythtv/libs/libmythtv/recorders/dtvsignalmonitor.cpp @@ -372,7 +372,12 @@ void DTVSignalMonitor::HandlePMT(uint, const ProgramMapTable *pmt) { if (pmt->IsEncrypted(GetDTVChannel()->GetSIStandard()) && !ignore_encrypted) + { + DVBChannel *dvbchannel = GetDVBChannel(); + if (dvbchannel) + dvbchannel->SetPMT(pmt); AddFlags(kDTVSigMon_WaitForCrypt); + } AddFlags(kDTVSigMon_PMTMatch); } @@ -546,6 +551,11 @@ const ScanStreamData *DTVSignalMonitor::GetScanStreamData() const return dynamic_cast(stream_data); } +DVBChannel *DTVSignalMonitor::GetDVBChannel(void) +{ + return dynamic_cast(channel); +} + bool DTVSignalMonitor::IsAllGood(void) const { QMutexLocker locker(&statusLock); diff --git a/mythtv/libs/libmythtv/recorders/dtvsignalmonitor.h b/mythtv/libs/libmythtv/recorders/dtvsignalmonitor.h index bc5cfd3a37c..299e8036ae0 100644 --- a/mythtv/libs/libmythtv/recorders/dtvsignalmonitor.h +++ b/mythtv/libs/libmythtv/recorders/dtvsignalmonitor.h @@ -11,6 +11,7 @@ using namespace std; #include "streamlisteners.h" class DTVChannel; +class DVBChannel; class DTVSignalMonitor : public SignalMonitor, public MPEGStreamListener, @@ -103,6 +104,7 @@ class DTVSignalMonitor : public SignalMonitor, protected: DTVChannel *GetDTVChannel(void); + DVBChannel *GetDVBChannel(void); void UpdateMonitorValues(void); void UpdateListeningForEIT(void); diff --git a/mythtv/libs/libmythtv/recorders/dvbchannel.cpp b/mythtv/libs/libmythtv/recorders/dvbchannel.cpp index 323670eecb7..6d1b462809d 100644 --- a/mythtv/libs/libmythtv/recorders/dvbchannel.cpp +++ b/mythtv/libs/libmythtv/recorders/dvbchannel.cpp @@ -272,8 +272,6 @@ bool DVBChannel::Open(DVBChannel *who) diseqc_tree->Open(fd_frontend); } - dvbcam->Start(); - first_tune = true; if (!InitializeInputs()) @@ -464,7 +462,7 @@ bool DVBChannel::CheckCodeRate(DTVCodeRate rate) const } /** - * \brief Return true iff modulation is supported modulation on the frontend + * \brief Return true if modulation is supported modulation on the frontend */ bool DVBChannel::CheckModulation(DTVModulation modulation) const { @@ -491,6 +489,8 @@ bool DVBChannel::CheckModulation(DTVModulation modulation) const */ void DVBChannel::SetPMT(const ProgramMapTable *pmt) { + if (!dvbcam->IsRunning()) + dvbcam->Start(); if (pmt && dvbcam->IsRunning()) dvbcam->SetPMT(this, pmt); } diff --git a/mythtv/libs/libmythtv/recorders/dvbrecorder.cpp b/mythtv/libs/libmythtv/recorders/dvbrecorder.cpp index e0ea31f165b..b3fde71e551 100644 --- a/mythtv/libs/libmythtv/recorders/dvbrecorder.cpp +++ b/mythtv/libs/libmythtv/recorders/dvbrecorder.cpp @@ -181,7 +181,8 @@ QString DVBRecorder::GetSIStandard(void) const void DVBRecorder::SetCAMPMT(const ProgramMapTable *pmt) { - _channel->SetPMT(pmt); + if (pmt->IsEncrypted(_channel->GetSIStandard())) + _channel->SetPMT(pmt); } void DVBRecorder::UpdateCAMTimeOffset(void) diff --git a/mythtv/libs/libmythtv/recorders/dvbsignalmonitor.cpp b/mythtv/libs/libmythtv/recorders/dvbsignalmonitor.cpp index 1ccc03f3096..44e51b51e72 100644 --- a/mythtv/libs/libmythtv/recorders/dvbsignalmonitor.cpp +++ b/mythtv/libs/libmythtv/recorders/dvbsignalmonitor.cpp @@ -17,7 +17,6 @@ #include "cardutil.h" #include "dvbtypes.h" -#include "dvbchannel.h" #include "dvbrecorder.h" #include "dvbstreamhandler.h" @@ -172,13 +171,6 @@ QStringList DVBSignalMonitor::GetStatusList(void) const void DVBSignalMonitor::HandlePMT(uint program_num, const ProgramMapTable *pmt) { DTVSignalMonitor::HandlePMT(program_num, pmt); - - if (pmt->ProgramNumber() == (uint)programNumber) - { - DVBChannel *dvbchannel = GetDVBChannel(); - if (dvbchannel) - dvbchannel->SetPMT(pmt); - } } void DVBSignalMonitor::HandleSTT(const SystemTimeTable *stt)