Ticket #2741: 20061128_dvb_on_demand.diff

File 20061128_dvb_on_demand.diff, 4.0 KB (added by Janne <janne-mythtv@…>, 19 years ago)
  • mythtv/libs/libmythtv/dbcheck.cpp

    diff --git a/mythtv/libs/libmythtv/dbcheck.cpp b/mythtv/libs/libmythtv/dbcheck.cpp
    index 3a95a46..35e7480 100644
    a b using namespace std;  
    1010#include "mythdbcon.h"
    1111
    1212/// This is the DB schema version expected by the running MythTV instance.
    13 const QString currentDatabaseVersion = "1170";
     13const QString currentDatabaseVersion = "1171";
    1414
    1515static bool UpdateDBVersionNumber(const QString &newnumber);
    1616static bool performActualUpdate(const QString updates[], QString version,
    thequery,  
    27292729            return false;
    27302730    }
    27312731
     2732    if (dbver == "1170")
     2733    {
     2734        const QString updates[] = {
     2735"UPDATE capturecard,cardinput,videosource "
     2736"   SET dvb_on_demand = 0 "
     2737" WHERE capturecard.cardid = cardinput.cardid "
     2738"   AND cardinput.sourceid = videosource.sourceid "
     2739"   AND useeit = 1 "
     2740"   AND dvb_on_demand = 1;",
     2741""};
     2742
     2743        if (!performActualUpdate(updates, "1171", dbver))
     2744            return false;
     2745    }
     2746
    27322747
    27332748//"ALTER TABLE cardinput DROP COLUMN preference;" in 0.22
    27342749//"ALTER TABLE channel DROP COLUMN atscsrcid;" in 0.22
  • mythtv/libs/libmythtv/eitscanner.cpp

    diff --git a/mythtv/libs/libmythtv/eitscanner.cpp b/mythtv/libs/libmythtv/eitscanner.cpp
    index d9546b8..d60319c 100644
    a b void EITScanner::RunEventLoop(void)  
    125125            }
    126126
    127127            if (activeScanNextChan == activeScanChannels.end())
    128                 activeScanNextChan = activeScanChannels.begin();
     128            {
     129                exitThread = true;
     130                break;
     131            }
    129132 
    130133            if (!(*activeScanNextChan).isEmpty())
    131134            {
  • mythtv/libs/libmythtv/tv_rec.cpp

    diff --git a/mythtv/libs/libmythtv/tv_rec.cpp b/mythtv/libs/libmythtv/tv_rec.cpp
    index 459d10f..ffb83e5 100644
    a b void *TVRec::RecorderThread(void *param)  
    11431143    return NULL;
    11441144}
    11451145
    1146 bool get_use_eit(uint cardid)
     1146static bool get_use_eit(uint cardid)
    11471147{
    11481148    MSqlQuery query(MSqlQuery::InitCon());
    11491149    query.prepare(
    static bool is_dishnet_eit(int cardid)  
    11831183    return false;
    11841184}
    11851185
     1186static bool get_dvb_on_demand(uint cardid)
     1187{
     1188    MSqlQuery query(MSqlQuery::InitCon());
     1189    query.prepare(
     1190        "SELECT dvb_on_demand "
     1191        "FROM capturecard "
     1192        "WHERE cardid     = :CARDID");
     1193    query.bindValue(":CARDID", cardid);
     1194
     1195    if (!query.exec() || !query.isActive())
     1196    {
     1197        MythContext::DBError("get_dvb_on_demand", query);
     1198        return false;
     1199    }
     1200    else if (query.next())
     1201        return query.value(0).toBool();
     1202    return false;
     1203}
     1204
    11861205/** \fn TVRec::RunTV(void)
    11871206 *  \brief Event handling method, contains event loop.
    11881207 */
    void TVRec::RunTV(void)  
    13451364                        "for all sources on this card.");
    13461365                eitScanStartTime = eitScanStartTime.addYears(1);
    13471366            }
     1367            else if (get_dvb_on_demand(GetCaptureCardNum()))
     1368            {
     1369                VERBOSE(VB_EIT, LOC + "EIT scanning disabled "
     1370                        "since the card should be used only on demand.");
     1371                eitScanStartTime = eitScanStartTime.addYears(1);
     1372            }
    13481373            else
    13491374            {
    13501375                scanner->StartActiveScan(
  • mythtv/libs/libmythtv/videosource.cpp

    diff --git a/mythtv/libs/libmythtv/videosource.cpp b/mythtv/libs/libmythtv/videosource.cpp
    index 67eb18d..c8d2b4a 100644
    a b class DVBOnDemand : public CheckBoxSetti  
    908908        setHelpText(
    909909            QObject::tr("This option makes the backend dvb-recorder "
    910910                        "only open the card when it is actually in-use, leaving "
    911                         "it free for other programs at other times."));
     911                        "it free for other programs at other times "
     912                        "(only recording and live-tv qualify as in-use, "
     913                        "the EIT scan does not)."));
    912914    };
    913915};
    914916