Ticket #2741: disable_active_eitscan.diff

File disable_active_eitscan.diff, 5.7 KB (added by janne, 4 years ago)

Add an option to disable active eit scan per dvb device

  • libs/libmythtv/dbcheck.cpp

    old new using namespace std; 
    1313#define MINIMUM_DBMS_VERSION 5 
    1414 
    1515/// This is the DB schema version expected by the running MythTV instance. 
    16 const QString currentDatabaseVersion = "1208"; 
     16const QString currentDatabaseVersion = "1209"; 
    1717 
    1818static bool UpdateDBVersionNumber(const QString &newnumber); 
    1919static bool performActualUpdate(const QString updates[], QString version, 
    thequery, 
    34073407            return false; 
    34083408    } 
    34093409 
     3410    if (dbver == "1208") 
     3411    { 
     3412        const QString updates[] = { 
     3413"ALTER TABLE capturecard ADD dvb_eitscan tinyint(1) NOT NULL default '1'; ", 
     3414"" 
     3415}; 
     3416        if (!performActualUpdate(updates, "1209", dbver)) 
     3417            return false; 
     3418    } 
     3419 
    34103420//"ALTER TABLE cardinput DROP COLUMN preference;" in 0.22 
    34113421//"ALTER TABLE channel DROP COLUMN atscsrcid;" in 0.22 
    34123422//"ALTER TABLE recordedmarkup DROP COLUMN offset;" in 0.22 
  • libs/libmythtv/tv_rec.cpp

    old new void TVRec::RunTV(void) 
    14471447        if (channel && scanner && 
    14481448            QDateTime::currentDateTime() > eitScanStartTime) 
    14491449        { 
    1450             if (!get_use_eit(GetCaptureCardNum())) 
     1450            if (!dvbOpt.dvb_eitscan) 
     1451            { 
     1452                VERBOSE(VB_EIT, LOC + "EIT scanning disabled for this card."); 
     1453                eitScanStartTime = eitScanStartTime.addYears(1); 
     1454            } 
     1455            else if (!get_use_eit(GetCaptureCardNum())) 
    14511456            { 
    14521457                VERBOSE(VB_EIT, LOC + "EIT scanning disabled " 
    14531458                        "for all sources on this card."); 
    bool TVRec::GetDevices(int cardid, 
    15901595        "       skipbtaudio,      signal_timeout,      channel_timeout, " 
    15911596        "       dvb_wait_for_seqstart, " 
    15921597        "" 
    1593         "       dvb_on_demand,    dvb_tuning_delay, " 
     1598        "       dvb_on_demand,    dvb_tuning_delay,    dvb_eitscan" 
    15941599        "" 
    15951600        "       firewire_speed,   firewire_model,      firewire_connection, " 
    15961601        "" 
    bool TVRec::GetDevices(int cardid, 
    16491654    uint dvboff = 10; 
    16501655    dvb_opts.dvb_on_demand    = query.value(dvboff + 0).toUInt(); 
    16511656    dvb_opts.dvb_tuning_delay = query.value(dvboff + 1).toUInt(); 
     1657    dvb_opts.dvb_eitscan      = query.value(dvboff + 2).toUInt(); 
    16521658 
    16531659    // Firewire options 
    1654     uint fireoff = dvboff + 2; 
     1660    uint fireoff = dvboff + 3; 
    16551661    firewire_opts.speed       = query.value(fireoff + 0).toUInt(); 
    16561662 
    16571663    test = query.value(fireoff + 1).toString(); 
  • libs/libmythtv/tv_rec.h

    old new class GeneralDBOptions 
    7979class DVBDBOptions 
    8080{ 
    8181  public: 
    82     DVBDBOptions() : dvb_on_demand(false), dvb_tuning_delay(0) {;} 
     82    DVBDBOptions() : dvb_on_demand(false), dvb_tuning_delay(0), dvb_eitscan(true) {;} 
    8383    bool dvb_on_demand; 
    8484    uint dvb_tuning_delay; 
     85    bool dvb_eitscan; 
    8586}; 
    8687 
    8788class FireWireDBOptions 
  • libs/libmythtv/videosource.cpp

    old new class DVBOnDemand : public CheckBoxSetti 
    10521052    }; 
    10531053}; 
    10541054 
     1055class DVBEITScan : public CheckBoxSetting, public CaptureCardDBStorage 
     1056{ 
     1057  public: 
     1058    DVBEITScan(const CaptureCard &parent) : 
     1059        CheckBoxSetting(this), 
     1060        CaptureCardDBStorage(this, parent, "dvb_eitscan") 
     1061    { 
     1062        setLabel(QObject::tr("Use DVB Card for active EIT scan")); 
     1063        setValue(true); 
     1064        setHelpText( 
     1065            QObject::tr("This option activates the active scan for " 
     1066                        "program data (EIT). With this option enabled " 
     1067                        "the DVB card is constantly in-use.")); 
     1068    }; 
     1069}; 
     1070 
    10551071class DVBTuningDelay : public SpinBoxSetting, public CaptureCardDBStorage 
    10561072{ 
    10571073  public: 
    RecorderOptions::RecorderOptions(Capture 
    29522968    rec->addChild(count); 
    29532969    rec->addChild(new DVBNoSeqStart(parent)); 
    29542970    rec->addChild(new DVBOnDemand(parent)); 
     2971    rec->addChild(new DVBEITScan(parent)); 
    29552972    rec->addChild(new DVBTuningDelay(parent)); 
    29562973 
    29572974    addChild(rec); 
  • libs/libmythtv/cardutil.cpp

    old new static uint clone_capturecard(uint src_c 
    468468        "SELECT videodevice,           cardtype,       defaultinput,     " 
    469469        "       hostname,              signal_timeout, channel_timeout,  " 
    470470        "       dvb_wait_for_seqstart, dvb_on_demand,  dvb_tuning_delay, " 
    471         "       dvb_diseqc_type,       diseqcid " 
     471        "       dvb_diseqc_type,       diseqcid,       dvb_eitscan " 
    472472        "FROM capturecard " 
    473473        "WHERE cardid = :CARDID"); 
    474474    query.bindValue(":CARDID", src_cardid); 
    static uint clone_capturecard(uint src_c 
    497497        "    dvb_on_demand         = :V7, " 
    498498        "    dvb_tuning_delay      = :V8, " 
    499499        "    dvb_diseqc_type       = :V9, " 
    500         "    diseqcid              = :V10 " 
     500        "    diseqcid              = :V10," 
     501        "    dvb_eitscan           = :V11 " 
    501502        "WHERE cardid = :CARDID"); 
    502     for (uint i = 0; i < 11; i++) 
     503    for (uint i = 0; i < 12; i++) 
    503504        query2.bindValue(QString(":V%1").arg(i), query.value(i).toString()); 
    504505    query2.bindValue(":CARDID", dst_cardid); 
    505506