Ticket #1728: 03_make_eitcache_persistant.diff

File 03_make_eitcache_persistant.diff, 5.6 KB (added by anonymous, 14 years ago)
  • libs/libmythtv/eithelper.cpp

    === libs/libmythtv/eithelper.cpp
    ==================================================================
     
    2626#define LOC QString("EITHelper: ")
    2727#define LOC_ERR QString("EITHelper, Error: ")
    2828
    29 EITHelper::EITHelper() :
    30     eitfixup(new EITFixUp()), eitcache(new EITCache()),
     29EITHelper::EITHelper(EITCache *cache) :
     30    eitfixup(new EITFixUp()), eitcache(cache),
    3131    gps_offset(-1 * GPS_LEAP_SECONDS),          utc_offset(0),
    3232    sourceid(0)
    3333{
  • libs/libmythtv/eithelper.h

    === libs/libmythtv/eithelper.h
    ==================================================================
     
    5151class EITHelper
    5252{
    5353  public:
    54     EITHelper();
     54    EITHelper(EITCache *cache);
    5555    virtual ~EITHelper();
    5656
    5757    uint GetListSize(void) const;
  • libs/libmythtv/eitscanner.h

    === libs/libmythtv/eitscanner.h
    ==================================================================
     
    1717class EITHelper;
    1818class dvb_channel_t;
    1919class ProgramMapTable;
     20class EITCache;
    2021
    2122class EITSource
    2223{
     
    2829class EITScanner
    2930{
    3031  public:
    31     EITScanner();
     32    EITScanner(EITCache *cache);
    3233    ~EITScanner() { TeardownAll(); }
    3334
    3435    void StartPassiveScan(ChannelBase*, EITSource*, bool ignore_source);
  • libs/libmythtv/tv_rec.cpp

    === libs/libmythtv/tv_rec.cpp
    ==================================================================
     
    117117       // Various components TVRec coordinates
    118118    : recorder(NULL), channel(NULL), signalMonitor(NULL),
    119119      scanner(NULL), dvbsiparser(NULL), dummyRecorder(NULL),
     120      eitcache(NULL),
    120121      // Configuration variables from database
    121122      transcodeFirst(false), earlyCommFlag(false), runJobOnHostOnly(false),
    122123      audioSampleRateDB(0), overRecordSecNrml(0), overRecordSecCat(0),
     
    151152    bool init_run = false;
    152153    if (genOpt.cardtype == "DVB")
    153154    {
    154         if (!scanner)
    155             scanner = new EITScanner();
     155        if (!scanner && eitcache)
     156            scanner = new EITScanner(eitcache);
    156157
    157158#ifdef USING_DVB
    158159        channel = new DVBChannel(genOpt.videodev.toInt(), this);
     
    904905#ifdef USING_HDHOMERUN
    905906        HDHRChannel  *hdhr_channel  = GetHDHRChannel();
    906907        HDHRRecorder *hdhr_recorder = GetHDHRRecorder();
    907         if (hdhr_channel && hdhr_recorder && !scanner)
     908        if (hdhr_channel && hdhr_recorder && !scanner && eitcache)
    908909        {
    909910            uint ignore = gContext->GetNumSetting("EITIgnoresSource", 0);
    910             scanner = new EITScanner();
     911            scanner = new EITScanner(eitcache);
    911912            scanner->StartPassiveScan(hdhr_channel, hdhr_recorder, ignore);
    912913        }
    913914#endif // USING_HDHOMERUN
  • libs/libmythtv/eitscanner.cpp

    === libs/libmythtv/eitscanner.cpp
    ==================================================================
     
    2525QDateTime  EITScanner::resched_next_time      = QDateTime::currentDateTime();
    2626const uint EITScanner::kMinRescheduleInterval = 150;
    2727
    28 EITScanner::EITScanner()
    29     : channel(NULL), eitSource(NULL), eitHelper(new EITHelper()),
     28EITScanner::EITScanner(EITCache *cache)
     29    : channel(NULL), eitSource(NULL), eitHelper(new EITHelper(cache)),
    3030      exitThread(false), rec(NULL), activeScan(false)
    3131{
    3232    QStringList langPref = iso639_get_language_list();
  • libs/libmythtv/tv_rec.h

    === libs/libmythtv/tv_rec.h
    ==================================================================
     
    2020class QSocket;
    2121class NuppelVideoRecorder;
    2222class RingBuffer;
     23class EITCache;
    2324class EITScanner;
    2425class DVBSIParser;
    2526class DummyDTVRecorder;
     
    256257    void DVBGotPMT(void)
    257258        { QMutexLocker lock(&stateChangeLock); triggerEventLoop.wakeAll(); }
    258259
     260    void SetEITCache(EITCache *cache) { eitcache = cache; }
     261
    259262  public slots:
    260263    void SignalMonitorAllGood() { triggerEventLoop.wakeAll(); }
    261264    void deleteLater(void);
     
    342345    RecorderBase     *recorder;
    343346    ChannelBase      *channel;
    344347    SignalMonitor    *signalMonitor;
     348    EITCache         *eitcache;
    345349    EITScanner       *scanner;
    346350    DVBSIParser      *dvbsiparser;
    347351    DummyDTVRecorder *dummyRecorder;
  • programs/mythbackend/eitactivescanner.cpp

    === programs/mythbackend/eitactivescanner.cpp
    ==================================================================
     
    4747{
    4848    exitThread = false;
    4949
    50 //     QMap<int, EncoderLink *>::iterator it = cardList->begin();
    51 //     for (; it != cardList->end(); ++it)
    52 //     {
    53 //         TVRec *rec = it.data()->GetTVRec();
    54 //         if (rec)
    55 //         {
    56 //             rec->SetEITCache(eitCache);
    57 //         }
    58 //     }
     50    QMap<int, EncoderLink *>::iterator it = cardList->begin();
     51    for (; it != cardList->end(); ++it)
     52    {
     53        TVRec *rec = it.data()->GetTVRec();
     54        if (rec)
     55        {
     56            rec->SetEITCache(eitCache);
     57        }
     58    }
    5959//    if (ismaster)
    6060        StartActiveScan();
    6161
     
    6666        if (ismaster && (QDateTime::currentDateTime() > activeScanNextTrig)
    6767            && !cardList->isEmpty())
    6868        {
    69 //             cerr << eitCache->GetStatistics() << endl;
     69            cerr << eitCache->GetStatistics() << endl;
    7070            if (activeScanNextCard == cardIDToSourceID.end())
    7171            {
    7272                activeScanNextCard = cardIDToSourceID.begin();