Ticket #13303: dvbsignalmonitor_use_db_value.patch

File dvbsignalmonitor_use_db_value.patch, 1.5 KB (added by Mike Bibbings, 6 years ago)
  • mythtv/libs/libmythtv/recorders/dvbsignalmonitor.cpp

    diff --git a/mythtv/libs/libmythtv/recorders/dvbsignalmonitor.cpp b/mythtv/libs/libmythtv/recorders/dvbsignalmonitor.cpp
    index d795d8e481..9ad65a9632 100644
    a b DVBSignalMonitor::DVBSignalMonitor(int db_cardnum, DVBChannel* _channel, 
    6161      streamHandlerStarted(false),
    6262      streamHandler(NULL)
    6363{
    64     // These two values should probably come from the database...
     64
    6565    int wait = 3000; // timeout when waiting on signal
     66
     67    // This value should probably come from the database...
    6668    int threshold = 0; // signal strength threshold
    6769
     70    // get from database
     71    uint signal_timeout = 0; // not actually used
     72    uint tuning_timeout = 0; // max time for channel signal lock
     73    CardUtil::GetTimeouts(db_cardnum,signal_timeout,tuning_timeout);
     74    if (tuning_timeout < 3000) // maintain backwards compatibility
     75    {
     76        LOG(VB_CHANNEL, LOG_DEBUG, LOC + "DVBSignalMonitor::  " +
     77            QString("Tuning lock timeout from database = %1 ms using %2 ms to maintain backwards compatibility").arg(tuning_timeout).arg(wait));
     78    }
     79    else
     80    {
     81        wait = tuning_timeout;  // use value from database
     82        LOG(VB_CHANNEL, LOG_DEBUG, LOC + "DVBSignalMonitor::  " +
     83            QString("Using Tuning lock timeout from database = %1 ms").arg(wait));
     84
     85    }
     86
    6887    signalLock.SetTimeout(wait);
    6988    signalStrength.SetTimeout(wait);
    7089    signalStrength.SetThreshold(threshold);