Ignore:
Timestamp:
12/01/17 18:16:49 (6 years ago)
Author:
gost
Message:

[titan] fix hybrid tuner... I hope

File:
1 edited

Legend:

Unmodified
Added
Removed
  • titan/titan/frontenddev.h

    r41319 r41330  
    14921492        int test2 = 0;
    14931493        struct dtv_property prop[1];
     1494        memset(prop, 0, sizeof(prop));
    14941495        prop[0].cmd = DTV_STAT_CNR;
    14951496        struct dtv_properties props;
     
    14971498        props.num = 1;
    14981499       
     1500        int wasopen = 0;
     1501       
     1502        if(node->fd == -1)
     1503                node->fd = feopen(node, NULL);
     1504        else
     1505                wasopen = 1;
     1506               
    14991507        if(ioctl(node->fd, FE_GET_PROPERTY,  &props) < 0 && errno != ERANGE)
    15001508        {
     
    15191527                }
    15201528        }
     1529        if(wasopen != 1)
     1530                feclose(node, -1);
    15211531#endif
    15221532        if(!signalquality && !signalqualitydb)
     
    15851595#if DVB_API_VERSION > 5 || DVB_API_VERSION == 5 && DVB_API_VERSION_MINOR >= 10
    15861596        struct dtv_property prop[1];
     1597        memset(prop, 0, sizeof(prop));
    15871598        prop[0].cmd = DTV_STAT_SIGNAL_STRENGTH;
    15881599        struct dtv_properties props;
    15891600        props.props = prop;
    15901601        props.num = 1;
     1602       
     1603        int wasopen = 0;
     1604       
     1605        if(node->fd == -1)
     1606                node->fd = feopen(node, NULL);
     1607        else
     1608                wasopen = 1;
     1609       
    15911610        if (ioctl(node->fd, FE_GET_PROPERTY, &props) < 0 && errno != ERANGE)
    15921611        {
     
    16021621        }
    16031622        if (signal)
     1623        {
     1624                if(wasopen != 1)
     1625                        feclose(node, -1);
    16041626                return signal;
     1627        }
    16051628        // fallback to old DVB API
    16061629//#endif
     
    16191642        {
    16201643                fe_status_t status = fereadstatus(node);
    1621                 if(status & FE_HAS_LOCK) signal = 65535;
     1644                if(status & FE_HAS_LOCK) signal = 1;
    16221645        }       
    16231646        return signal;
     
    21702193                                        if(getconfig(tmpstr, NULL) != NULL)
    21712194                                                sethypridtuner(y, getconfig(tmpstr, NULL));
    2172                                         //free(tmpstr), tmpstr = NULL;
     2195                                        free(tmpstr), tmpstr = NULL;
    21732196#endif
    21742197                                }
     
    21812204#ifdef MIPSEL
    21822205                                        if(fehyprid != NULL && getconfig(tmpstr, NULL) != NULL)
     2206                                        {
    21832207                                                sethypridtunernew(dvbnode, getconfig(tmpstr, NULL));
     2208                                                feinfo = fegetinfo(NULL, fd);
     2209                                                dvbnode->feinfo = feinfo;
     2210                                        }
    21842211                                        free(tmpstr), tmpstr = NULL;
    21852212#endif                                 
     
    22802307        int type = 0;
    22812308        int ret = 0;
     2309        int wasopen = 0;
    22822310        char* realname = gethypridtunerchoicesvaluename(tuner->devnr, value);
    22832311       
     2312        if(tuner->fd == -1)
     2313                tuner->fd = feopen(tuner, NULL);
     2314        else
     2315                wasopen = 1;
    22842316       
    22852317        printf("**** > realname: %s\n", realname);
     
    23362368        if (ioctl(tuner->fd, FE_SET_PROPERTY, &cmdseq) == -1)
    23372369        {
     2370                perr("FE_SET_PROPERTY");
    23382371                err("FE_SET_PROPERTY failed -> use procfs to switch delivery system tuner %d mode %s type %d",tuner->devnr ,value, type);
    23392372        }
     2373                if(wasopen != 1)
     2374                        feclose(tuner, -1);
    23402375                hypridtuner = getconfig("hypridtuner", NULL);
    23412376                if(hypridtuner != NULL)
Note: See TracChangeset for help on using the changeset viewer.