Ticket #11021: 0002-No_decrypting_of_unencrypted_channels_or_during_EIT-026.patch

File 0002-No_decrypting_of_unencrypted_channels_or_during_EIT-026.patch, 4.9 KB (added by Shinck@…, 8 years ago)

Patch for master / 0.26-rc

  • mythtv/libs/libmythtv/dtvsignalmonitor.cpp

    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) 
    370370    {
    371371        if (pmt->IsEncrypted(GetDTVChannel()->GetSIStandard()) &&
    372372            !ignore_encrypted)
     373        {
     374            DVBChannel *dvbchannel = GetDVBChannel();
     375            if (dvbchannel)
     376                dvbchannel->SetPMT(pmt);
    373377            AddFlags(kDTVSigMon_WaitForCrypt);
     378        }
    374379
    375380        AddFlags(kDTVSigMon_PMTMatch);
    376381    }
    const ScanStreamData *DTVSignalMonitor::GetScanStreamData() const 
    534539    return dynamic_cast<const ScanStreamData*>(stream_data);
    535540}
    536541
     542DVBChannel *DTVSignalMonitor::GetDVBChannel(void)
     543{
     544    return dynamic_cast<DVBChannel*>(channel);
     545}
     546
    537547bool DTVSignalMonitor::IsAllGood(void) const
    538548{
    539549    QMutexLocker locker(&statusLock);
  • mythtv/libs/libmythtv/dtvsignalmonitor.h

    diff --git a/mythtv/libs/libmythtv/dtvsignalmonitor.h b/mythtv/libs/libmythtv/dtvsignalmonitor.h
    index 0d14b7f..2be4302 100644
    a b using namespace std; 
    1111#include "streamlisteners.h"
    1212
    1313class DTVChannel;
     14class DVBChannel;
    1415
    1516class DTVSignalMonitor : public SignalMonitor,
    1617                         public MPEGStreamListener,
    class DTVSignalMonitor : public SignalMonitor, 
    103104
    104105  protected:
    105106    DTVChannel *GetDTVChannel(void);
     107    DVBChannel *GetDVBChannel(void);
    106108    void UpdateMonitorValues(void);
    107109    void UpdateListeningForEIT(void);
    108110
  • mythtv/libs/libmythtv/dvbchannel.cpp

    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) 
    272272            diseqc_tree->Open(fd_frontend);
    273273    }
    274274
    275     dvbcam->Start();
    276 
    277275    first_tune = true;
    278276
    279277    if (!InitializeInputs())
    bool DVBChannel::CheckCodeRate(DTVCodeRate rate) const 
    464462}
    465463
    466464/**
    467  *  \brief Return true iff modulation is supported modulation on the frontend
     465 *  \brief Return true if modulation is supported modulation on the frontend
    468466 */
    469467bool DVBChannel::CheckModulation(DTVModulation modulation) const
    470468{
    bool DVBChannel::CheckModulation(DTVModulation modulation) const 
    491489 */
    492490void DVBChannel::SetPMT(const ProgramMapTable *pmt)
    493491{
     492    if (!dvbcam->IsRunning())
     493        dvbcam->Start();
    494494    if (pmt && dvbcam->IsRunning())
    495495        dvbcam->SetPMT(this, pmt);
    496496}
  • mythtv/libs/libmythtv/dvbrecorder.cpp

    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 
    179179
    180180void DVBRecorder::SetCAMPMT(const ProgramMapTable *pmt)
    181181{
    182     _channel->SetPMT(pmt);
     182    if (pmt->IsEncrypted(_channel->GetSIStandard()))
     183        _channel->SetPMT(pmt);
    183184}
    184185
    185186void DVBRecorder::UpdateCAMTimeOffset(void)
  • mythtv/libs/libmythtv/dvbsignalmonitor.cpp

    diff --git a/mythtv/libs/libmythtv/dvbsignalmonitor.cpp b/mythtv/libs/libmythtv/dvbsignalmonitor.cpp
    index 1fa010e..db91fbe 100644
    a b  
    1717#include "cardutil.h"
    1818
    1919#include "dvbtypes.h"
    20 #include "dvbchannel.h"
    2120#include "dvbrecorder.h"
    2221#include "dvbstreamhandler.h"
    2322
    void DVBSignalMonitor::HandlePMT(uint program_num, const ProgramMapTable *pmt) 
    171170{
    172171    DTVSignalMonitor::HandlePMT(program_num, pmt);
    173172
    174     if (pmt->ProgramNumber() == (uint)programNumber)
     173/*    if (pmt->ProgramNumber() == (uint)programNumber)
    175174    {
    176175        DVBChannel *dvbchannel = GetDVBChannel();
    177176        if (dvbchannel)
    178177            dvbchannel->SetPMT(pmt);
    179178    }
     179*/
    180180}
    181181
    182182void DVBSignalMonitor::HandleSTT(const SystemTimeTable *stt)