From 59d0cf2db78ecd561d7f7edee6f8e9e725aa655a Mon Sep 17 00:00:00 2001
From: Sascha Hinck <SHinck@web.de>
Date: Sat, 18 Aug 2012 16:30:53 +0200
Subject: [PATCH] No use of CAM-Module and decrypting at EIT-Scan or not encrypted channels
SignalMonitor or Recorder initializes CAM-Module and sends CA_PMT for all
channels and programs, not only encrypted. They also do so for grabbing
EIT-Data with EIT-Scans. So all the time every few minutes during EIT-Scan
if channels change CAM is stopped and restarted (shows also up in syslog).
This fixes the behaviour. The CAM is only initialized and CA_PMT is sent if
a stream or program is encrypted and we want to record or look live-TV.
---
mythtv/libs/libmythtv/dtvsignalmonitor.cpp | 10 ++++++++++
mythtv/libs/libmythtv/dtvsignalmonitor.h | 2 ++
mythtv/libs/libmythtv/dvbchannel.cpp | 6 +++---
mythtv/libs/libmythtv/dvbrecorder.cpp | 3 ++-
mythtv/libs/libmythtv/dvbsignalmonitor.cpp | 4 ++--
5 files changed, 19 insertions(+), 6 deletions(-)
diff --git a/mythtv/libs/libmythtv/dtvsignalmonitor.cpp b/mythtv/libs/libmythtv/dtvsignalmonitor.cpp
index 7ed61f3..63148c0 100644
a
|
b
|
void DTVSignalMonitor::HandlePMT(uint, const ProgramMapTable *pmt) |
370 | 370 | { |
371 | 371 | if (pmt->IsEncrypted(GetDTVChannel()->GetSIStandard()) && |
372 | 372 | !ignore_encrypted) |
| 373 | { |
| 374 | DVBChannel *dvbchannel = GetDVBChannel(); |
| 375 | if (dvbchannel) |
| 376 | dvbchannel->SetPMT(pmt); |
373 | 377 | AddFlags(kDTVSigMon_WaitForCrypt); |
| 378 | } |
374 | 379 | |
375 | 380 | AddFlags(kDTVSigMon_PMTMatch); |
376 | 381 | } |
… |
… |
const ScanStreamData *DTVSignalMonitor::GetScanStreamData() const |
534 | 539 | return dynamic_cast<const ScanStreamData*>(stream_data); |
535 | 540 | } |
536 | 541 | |
| 542 | DVBChannel *DTVSignalMonitor::GetDVBChannel(void) |
| 543 | { |
| 544 | return dynamic_cast<DVBChannel*>(channel); |
| 545 | } |
| 546 | |
537 | 547 | bool DTVSignalMonitor::IsAllGood(void) const |
538 | 548 | { |
539 | 549 | QMutexLocker locker(&statusLock); |
diff --git a/mythtv/libs/libmythtv/dtvsignalmonitor.h b/mythtv/libs/libmythtv/dtvsignalmonitor.h
index 0d14b7f..2be4302 100644
a
|
b
|
using namespace std; |
11 | 11 | #include "streamlisteners.h" |
12 | 12 | |
13 | 13 | class DTVChannel; |
| 14 | class DVBChannel; |
14 | 15 | |
15 | 16 | class DTVSignalMonitor : public SignalMonitor, |
16 | 17 | public MPEGStreamListener, |
… |
… |
class DTVSignalMonitor : public SignalMonitor, |
103 | 104 | |
104 | 105 | protected: |
105 | 106 | DTVChannel *GetDTVChannel(void); |
| 107 | DVBChannel *GetDVBChannel(void); |
106 | 108 | void UpdateMonitorValues(void); |
107 | 109 | void UpdateListeningForEIT(void); |
108 | 110 | |
diff --git a/mythtv/libs/libmythtv/dvbchannel.cpp b/mythtv/libs/libmythtv/dvbchannel.cpp
index 5f25854..ef51851 100644
a
|
b
|
bool DVBChannel::Open(DVBChannel *who) |
272 | 272 | diseqc_tree->Open(fd_frontend); |
273 | 273 | } |
274 | 274 | |
275 | | dvbcam->Start(); |
276 | | |
277 | 275 | first_tune = true; |
278 | 276 | |
279 | 277 | if (!InitializeInputs()) |
… |
… |
bool DVBChannel::CheckCodeRate(DTVCodeRate rate) const |
464 | 462 | } |
465 | 463 | |
466 | 464 | /** |
467 | | * \brief Return true iff modulation is supported modulation on the frontend |
| 465 | * \brief Return true if modulation is supported modulation on the frontend |
468 | 466 | */ |
469 | 467 | bool DVBChannel::CheckModulation(DTVModulation modulation) const |
470 | 468 | { |
… |
… |
bool DVBChannel::CheckModulation(DTVModulation modulation) const |
491 | 489 | */ |
492 | 490 | void DVBChannel::SetPMT(const ProgramMapTable *pmt) |
493 | 491 | { |
| 492 | if (!dvbcam->IsRunning()) |
| 493 | dvbcam->Start(); |
494 | 494 | if (pmt && dvbcam->IsRunning()) |
495 | 495 | dvbcam->SetPMT(this, pmt); |
496 | 496 | } |
diff --git a/mythtv/libs/libmythtv/dvbrecorder.cpp b/mythtv/libs/libmythtv/dvbrecorder.cpp
index c1b66d5..8677071 100644
a
|
b
|
QString DVBRecorder::GetSIStandard(void) const |
179 | 179 | |
180 | 180 | void DVBRecorder::SetCAMPMT(const ProgramMapTable *pmt) |
181 | 181 | { |
182 | | _channel->SetPMT(pmt); |
| 182 | if (pmt->IsEncrypted(_channel->GetSIStandard())) |
| 183 | _channel->SetPMT(pmt); |
183 | 184 | } |
184 | 185 | |
185 | 186 | void DVBRecorder::UpdateCAMTimeOffset(void) |
diff --git a/mythtv/libs/libmythtv/dvbsignalmonitor.cpp b/mythtv/libs/libmythtv/dvbsignalmonitor.cpp
index 1fa010e..db91fbe 100644
a
|
b
|
|
17 | 17 | #include "cardutil.h" |
18 | 18 | |
19 | 19 | #include "dvbtypes.h" |
20 | | #include "dvbchannel.h" |
21 | 20 | #include "dvbrecorder.h" |
22 | 21 | #include "dvbstreamhandler.h" |
23 | 22 | |
… |
… |
void DVBSignalMonitor::HandlePMT(uint program_num, const ProgramMapTable *pmt) |
171 | 170 | { |
172 | 171 | DTVSignalMonitor::HandlePMT(program_num, pmt); |
173 | 172 | |
174 | | if (pmt->ProgramNumber() == (uint)programNumber) |
| 173 | /* if (pmt->ProgramNumber() == (uint)programNumber) |
175 | 174 | { |
176 | 175 | DVBChannel *dvbchannel = GetDVBChannel(); |
177 | 176 | if (dvbchannel) |
178 | 177 | dvbchannel->SetPMT(pmt); |
179 | 178 | } |
| 179 | */ |
180 | 180 | } |
181 | 181 | |
182 | 182 | void DVBSignalMonitor::HandleSTT(const SystemTimeTable *stt) |