Ticket #1573: eit1.diff

File eit1.diff, 10.2 KB (added by Mark.Buechler@…, 18 years ago)

The patch..

  • mythtv/libs/libmythtv/dbcheck.cpp

     
    1010#include "mythdbcon.h"
    1111
    1212/// This is the DB schema version expected by the running MythTV instance.
    13 const QString currentDatabaseVersion = "1133";
     13const QString currentDatabaseVersion = "1134";
    1414
    1515static bool UpdateDBVersionNumber(const QString &newnumber);
    1616static bool performActualUpdate(const QString updates[], QString version,
     
    21572157            return false;
    21582158    }
    21592159
     2160    if (dbver == "1133")
     2161    {
     2162        const QString updates[] = {
     2163// Dish Network
     2164"INSERT INTO dtv_privatetypes (sitype, networkid, private_type, private_value)"
     2165" VALUES('dvb', 4102, 'force_guide_present', 'yes');",
     2166"INSERT INTO dtv_privatetypes (sitype, networkid, private_type, private_value)"
     2167" VALUES('dvb', 4102, 'extended_guide_tid', '229');", 
     2168
     2169// Bell ExpressVu
     2170"INSERT INTO dtv_privatetypes (sitype, networkid, private_type, private_value)"
     2171" VALUES('dvb', 256, 'force_guide_present', 'yes');",
     2172"INSERT INTO dtv_privatetypes (sitype, networkid, private_type, private_value)"
     2173" VALUES('dvb', 256, 'guide_on_single_tid', 'yes');",         
     2174"INSERT INTO dtv_privatetypes (sitype, networkid, private_type, private_value)"
     2175" VALUES('dvb', 257, 'force_guide_present', 'yes');",
     2176"INSERT INTO dtv_privatetypes (sitype, networkid, private_type, private_value)"
     2177" VALUES('dvb', 257, 'guide_on_single_tid', 'yes');",
     2178"INSERT INTO dtv_privatetypes (sitype, networkid, private_type, private_value)"
     2179" VALUES('dvb', 256, 'standard_guide_tid', '4');",               
     2180"INSERT INTO dtv_privatetypes (sitype, networkid, private_type, private_value)"
     2181" VALUES('dvb', 257, 'standard_guide_tid', '102');",                 
     2182""
     2183};
     2184
     2185        if (!performActualUpdate(updates, "1134", dbver))
     2186            return false;
     2187    }
     2188
    21602189//"ALTER TABLE capturecard DROP COLUMN dvb_recordts;" in 0.21
    21612190//"ALTER TABLE capturecard DROP COLUMN dvb_hw_decoder;" in 0.21
    21622191//"ALTER TABLE cardinput DROP COLUMN  preference;" in 0.22
  • mythtv/libs/libmythtv/eitscanner.h

     
    2828    void StopPassiveScan(void);
    2929
    3030    void StartActiveScan(TVRec*, uint max_seconds_per_source,
    31                          bool ignore_source);
     31                         bool ignore_source, bool limit_transport=false);
    3232
    3333    void StopActiveScan(void);       
    3434
  • mythtv/libs/libmythtv/tv_rec.cpp

     
    7878#define LOC QString("TVRec(%1): ").arg(cardid)
    7979#define LOC_ERR QString("TVRec(%1) Error: ").arg(cardid)
    8080
    81 /// How many seconds after entering kState_None should we start EIT Scanner
    82 const uint TVRec::kEITScanStartTimeout = 60; /* 1 minute */
    83 
    8481/// How many milliseconds the signal monitor should wait between checks
    8582const uint TVRec::kSignalMonitoringRate = 50; /* msec */
    8683
     
    768765    {
    769766        // Add some randomness to avoid all cards starting
    770767        // EIT scanning at nearly the same time.
    771         uint timeout = kEITScanStartTimeout + random() % 59;
     768        uint idle_start = gContext->GetNumSetting("EITCrawIdleStart", 1);
     769        uint timeout = (idle_start * 60) + random() % 59;
    772770        eitScanStartTime = eitScanStartTime.addSecs(timeout);
    773771    }
    774772    else
     
    12071205
    12081206    // Add some randomness to avoid all cards starting
    12091207    // EIT scanning at nearly the same time.
    1210     uint timeout = kEITScanStartTimeout + random() % 59;
     1208    uint idle_start = gContext->GetNumSetting("EITCrawIdleStart", 1);
     1209    uint timeout = (idle_start * 60) + random() % 59;
    12111210    eitScanStartTime = QDateTime::currentDateTime().addSecs(timeout);
    12121211
    12131212    while (HasFlags(kFlagRunMainLoop))
     
    13431342            {
    13441343                uint ttMin = gContext->GetNumSetting("EITTransportTimeout", 5);
    13451344                uint ignore = gContext->GetNumSetting("EITIgnoresSource", 0);
    1346                 scanner->StartActiveScan(this, ttMin * 60, ignore);
     1345                uint tid_limit = gContext->GetNumSetting("EITCrawLimitTransports", 0);
     1346                scanner->StartActiveScan(this, ttMin * 60, ignore, tid_limit);
    13471347                SetFlags(kFlagEITScannerRunning);
    13481348                eitScanStartTime = QDateTime::currentDateTime().addYears(1);
    13491349            }
  • mythtv/libs/libmythtv/eitscanner.cpp

     
    183183}
    184184
    185185void EITScanner::StartActiveScan(TVRec *_rec, uint max_seconds_per_source,
    186                                  bool _ignore_source)
     186                                 bool _ignore_source, bool limit_transports)
    187187{
    188188    rec           = _rec;
    189189    ignore_source = _ignore_source;
     
    191191    if (!activeScanChannels.size())
    192192    {
    193193        MSqlQuery query(MSqlQuery::InitCon());
    194         query.prepare(
    195             "SELECT channum, mplexid "
    196             "FROM channel, cardinput, capturecard, videosource "
    197             "WHERE cardinput.sourceid   = channel.sourceid AND "
    198             "      videosource.sourceid = channel.sourceid AND "
    199             "      capturecard.cardid   = cardinput.cardid AND "
    200             "      channel.mplexid        IS NOT NULL      AND "
    201             "      useonairguide        = 1                AND "
    202             "      useeit               = 1                AND "
    203             "      cardinput.cardid     = :CARDID "
    204             "ORDER BY cardinput.sourceid, atscsrcid");
     194
     195        if (limit_transports)
     196            query.prepare(
     197                "SELECT MIN(channum), channel.mplexid                        "
     198                "FROM channel, dtv_multiplex, dtv_privatetypes, videosource, "
     199                "cardinput, capturecard                                      "
     200                "WHERE dtv_multiplex.networkid = dtv_privatetypes.networkid  "
     201                "AND videosource.sourceid      = channel.sourceid            "
     202                "AND cardinput.sourceid        = channel.sourceid            "
     203                "AND capturecard.cardid        = cardinput.cardid            "
     204                "AND (private_type             = 'extended_guide_tid'        "
     205                "OR   private_type             = 'standard_guide_tid')       "
     206                "AND private_value             = transportid                 "
     207                "AND channel.mplexid           = dtv_multiplex.mplexid       "
     208                "AND useonairguide             = 1                           "
     209                "AND useeit                    = 1                           "
     210                "AND cardinput.cardid          = :CARDID                     "
     211                "GROUP BY transportid");
     212        else
     213            query.prepare(
     214                "SELECT channum, mplexid "
     215                "FROM channel, cardinput, capturecard, videosource "
     216                "WHERE cardinput.sourceid   = channel.sourceid AND "
     217                "      videosource.sourceid = channel.sourceid AND "
     218                "      capturecard.cardid   = cardinput.cardid AND "
     219                "      channel.mplexid        IS NOT NULL      AND "
     220                "      useonairguide        = 1                AND "
     221                "      useeit               = 1                AND "
     222                "      cardinput.cardid     = :CARDID "
     223                "ORDER BY cardinput.sourceid, atscsrcid");
     224
    205225        query.bindValue(":CARDID", rec->GetCaptureCardNum());
    206226
    207227        if (!query.exec() || !query.isActive())
  • mythtv/libs/libmythtv/tv_rec.h

     
    372372    QString      rbFileExt;
    373373
    374374  public:
    375     static const uint kEITScanStartTimeout;
    376375    static const uint kSignalMonitoringRate;
    377376
    378377    // General State flags
  • mythtv/setup/backendsettings.cpp

     
    252252    return gc;
    253253};
    254254
     255static GlobalSpinBox *EITCrawIdleStart()
     256{
     257    GlobalSpinBox *gc = new GlobalSpinBox("EITCrawIdleStart", 1, 120, 1);
     258    gc->setLabel(QObject::tr("Backend Idle Before EIT Craw (mins)"));
     259    gc->setValue(1);
     260    QString help = QObject::tr(
     261        "The amount of idle time, in minutes, to wait before listings "
     262        "data is collected.");
     263    gc->setHelpText(help);
     264    return gc;
     265}
    255266
     267static GlobalCheckBox *EITCrawLimitTransports()
     268{
     269    GlobalCheckBox *gc = new GlobalCheckBox("EITCrawLimitTransports");
     270    gc->setLabel(QObject::tr("EIT Craw Limits Transports"));
     271    gc->setValue(false);
     272    QString help = QObject::tr("If set, listings data collected during "
     273                               "idle times will only be for providers which "
     274                               "have extended guide information available on "
     275                               "selective transports.");
     276    gc->setHelpText(help);
     277    return gc;
     278};
     279
    256280static GlobalSpinBox *WOLbackendReconnectWaitTime()
    257281{
    258282    GlobalSpinBox *gc = new GlobalSpinBox("WOLbackendReconnectWaitTime", 0, 1200, 5);
     
    670694    group2a1->setLabel(QObject::tr("EIT Scanner Options"));               
    671695    group2a1->addChild(EITTransportTimeout());
    672696    group2a1->addChild(EITIgnoresSource());
     697    group2a1->addChild(EITCrawIdleStart());
     698    group2a1->addChild(EITCrawLimitTransports());
    673699    addChild(group2a1);
    674700
    675701    VerticalConfigurationGroup* group3 = new VerticalConfigurationGroup(false);