Ticket #13386: 20190126-dvbchannelscan-dvbv5.patch

File 20190126-dvbchannelscan-dvbv5.patch, 2.3 KB (added by Klaas de Waal, 8 years ago)
  • mythtv/libs/libmythtv/recorders/dvbchannel.cpp

    diff --git a/mythtv/libs/libmythtv/recorders/dvbchannel.cpp b/mythtv/libs/libmythtv/recorders/dvbchannel.cpp
    index a21d35df3f..e0f55d02c7 100644
    a b  
    4949#include "dvbcam.h"
    5050#include "tv_rec.h"
    5151
     52// Returned by drivers on unsupported dvbv3 ioctl calls
     53#ifndef ENOTSUPP
     54#define ENOTSUPP 524
     55#endif
     56
    5257static void drain_dvb_events(int fd);
    5358static bool wait_for_backend(int fd, int timeout_ms);
    5459static struct dvb_frontend_parameters dtvmultiplex_to_dvbparams(
    double DVBChannel::GetSignalStrength(bool *ok) const  
    11671172    if (ret < 0)
    11681173    {
    11691174#if DVB_API_VERSION >=5
    1170         if (errno == EOPNOTSUPP)
     1175        if (errno == EOPNOTSUPP || errno == ENOTSUPP)
    11711176        {
    11721177            return GetSignalStrengthDVBv5(ok);
    11731178        }
    double DVBChannel::GetSNR(bool *ok) const  
    12551260    if (ret < 0)
    12561261    {
    12571262#if DVB_API_VERSION >=5
    1258         if (errno == EOPNOTSUPP)
     1263        if (errno == EOPNOTSUPP || errno == ENOTSUPP)
    12591264        {
    12601265            return GetSNRDVBv5(ok);
    12611266        }
    double DVBChannel::GetBitErrorRate(bool *ok) const  
    13261331    if (ret < 0)
    13271332    {
    13281333#if DVB_API_VERSION >=5
    1329         if (errno == EOPNOTSUPP)
     1334        if (errno == EOPNOTSUPP || errno == ENOTSUPP)
    13301335        {
    13311336            return GetBitErrorRateDVBv5(ok);
    13321337        }
    double DVBChannel::GetUncorrectedBlockCount(bool *ok) const  
    13901395    if (ret < 0)
    13911396    {
    13921397#if DVB_API_VERSION >=5
    1393         if (errno == EOPNOTSUPP)
     1398        if (errno == EOPNOTSUPP || errno == ENOTSUPP)
    13941399        {
    13951400            return GetUncorrectedBlockCountDVBv5(ok);
    13961401        }
    static void drain_dvb_events(int fd)  
    14941499 */
    14951500static bool wait_for_backend(int fd, int timeout_ms)
    14961501{
    1497     struct timeval select_timeout = { 0, (timeout_ms % 1000) * 1000 /*usec*/};
     1502    struct timeval select_timeout = { timeout_ms / 1000, (timeout_ms % 1000) * 1000 /*usec*/};
     1503
    14981504    fd_set fd_select_set;
    14991505    FD_ZERO(    &fd_select_set);
    15001506    FD_SET (fd, &fd_select_set);
    static bool wait_for_backend(int fd, int timeout_ms)  
    15151521
    15161522    // This is supposed to work on all cards, post 2.6.12...
    15171523    fe_status_t status;
     1524    memset(&status, 0, sizeof(status));
     1525
    15181526    if (ioctl(fd, FE_READ_STATUS, &status) < 0)
    15191527    {
    15201528        LOG(VB_GENERAL, LOG_ERR,