Ticket #13371: 20190112-hdhr-dvbc.patch

File 20190112-hdhr-dvbc.patch, 3.6 KB (added by Klaas de Waal, 5 years ago)

Change tuner type to DVB-C for HDHomeRun DVB-C devices

  • mythtv/libs/libmythtv/cardutil.cpp

    diff --git a/mythtv/libs/libmythtv/cardutil.cpp b/mythtv/libs/libmythtv/cardutil.cpp
    index 1e32a2bc88..f808f3497a 100644
    a b bool CardUtil::HDHRdoesDVB(const QString &device) 
    22632263    return false;
    22642264}
    22652265
     2266/**
     2267 * If the device is valid, check if the model does DVB-C.
     2268 *
     2269 * \todo This is cut&paste of HDHRdoesDVB, could be merged.
     2270 */
     2271
     2272bool CardUtil::HDHRdoesDVBC(const QString &device)
     2273{
     2274    (void) device;
     2275
     2276#ifdef USING_HDHOMERUN
     2277    hdhomerun_device_t  *hdhr;
     2278    hdhr = hdhomerun_device_create_from_str(device.toLatin1(), nullptr);
     2279    if (!hdhr)
     2280        return false;
     2281
     2282    const char *model = hdhomerun_device_get_model_str(hdhr);
     2283    if (model && strstr(model, "dvbc"))
     2284    {
     2285        hdhomerun_device_destroy(hdhr);
     2286        return true;
     2287    }
     2288
     2289    hdhomerun_device_destroy(hdhr);
     2290
     2291#endif
     2292
     2293    return false;
     2294}
     2295
    22662296/**
    22672297 * Get a nicely formatted string describing the device
    22682298 */
  • mythtv/libs/libmythtv/cardutil.h

    diff --git a/mythtv/libs/libmythtv/cardutil.h b/mythtv/libs/libmythtv/cardutil.h
    index 52a5ba1c99..6bbf5a627f 100644
    a b class MTV_PUBLIC CardUtil 
    389389
    390390    // HDHomeRun info
    391391    static bool         HDHRdoesDVB(const QString &device);
     392    static bool         HDHRdoesDVBC(const QString &device);
    392393    static QString      GetHDHRdesc(const QString &device);
    393394
    394395    // VBox info
  • mythtv/libs/libmythtv/channelscan/scanwizardconfig.cpp

    diff --git a/mythtv/libs/libmythtv/channelscan/scanwizardconfig.cpp b/mythtv/libs/libmythtv/channelscan/scanwizardconfig.cpp
    index efc4bfc2d6..e53f537283 100644
    a b void ScanTypeSetting::SetInput(const QString &cardids_inputname) 
    167167                         QString::number(ExistingScanImport));
    168168            break;
    169169        case CardUtil::HDHOMERUN:
    170             if (CardUtil::HDHRdoesDVB(CardUtil::GetVideoDevice(cardid)))
     170            if (CardUtil::HDHRdoesDVBC(CardUtil::GetVideoDevice(cardid)))
     171            {
     172                addSelection(tr("Full Scan (Tuned)"),
     173                             QString::number(NITAddScan_DVBC));
     174                addSelection(tr("Full Scan"),
     175                             QString::number(FullScan_DVBC), true);
     176            }
     177            else if (CardUtil::HDHRdoesDVB(CardUtil::GetVideoDevice(cardid)))
    171178            {
    172179                addSelection(tr("Full Scan"),
    173180                             QString::number(FullScan_DVBT), true);
  • mythtv/libs/libmythtv/recorders/hdhrstreamhandler.cpp

    diff --git a/mythtv/libs/libmythtv/recorders/hdhrstreamhandler.cpp b/mythtv/libs/libmythtv/recorders/hdhrstreamhandler.cpp
    index 9eb32c9c78..40ab716b76 100644
    a b bool HDHRStreamHandler::Open(void) 
    329329                _tuner_types.push_back(DTVTunerType(DTVTunerType::kTunerTypeOCUR));
    330330            }
    331331        }
    332         else if (QString(model).toLower().contains("dvb"))
     332        else if (QString(model).toLower().endsWith("dvbc"))
     333        {
     334            _tuner_types.push_back(DTVTunerType(DTVTunerType::kTunerTypeDVBC));
     335        }
     336        else if (QString(model).toLower().endsWith("dvbt"))
     337        {
     338            _tuner_types.push_back(DTVTunerType(DTVTunerType::kTunerTypeDVBT));
     339        }
     340        else if (QString(model).toLower().endsWith("dvbtc"))
    333341        {
    334342            _tuner_types.push_back(DTVTunerType(DTVTunerType::kTunerTypeDVBT));
    335343            _tuner_types.push_back(DTVTunerType(DTVTunerType::kTunerTypeDVBC));