Changeset 41090


Ignore:
Timestamp:
11/01/17 21:19:31 (6 years ago)
Author:
gost
Message:

fix hyprit/fbc tuner... I hope

File:
1 edited

Legend:

Unmodified
Added
Removed
  • titan/titan/frontenddev.h

    r41088 r41090  
    304304                                return(dvbnode);
    305305                        }
     306                }
     307                dvbnode = dvbnode->next;
     308        }
     309        if(dvbfirst != NULL)
     310                dvbnode = dvbfirst;
     311        else
     312                dvbnode = dvbdev;
     313
     314        //suche tuner der die gewuenschte orbitalpos kann und belegt ist und dessen looptuner es kann
     315        while(dvbnode != NULL)
     316        {
     317                //FRONTENDDEV first in the list
     318                if(dvbnode->type != FRONTENDDEV) break;
     319
     320                //check if tuner is deactivate
     321                if(dvbnode->deactive == 1)
     322                {
     323                        dvbnode = dvbnode->next;
     324                        continue;
     325                }
     326                if(dvbnode->type == FRONTENDDEV && dvbnode->feinfo->type == tpnode->fetype && dvbnode->felock != 0)
     327                {
     328                        if(flag == 2 && status.aktservice->fedev == dvbnode)
     329                        {
     330                                dvbnode = dvbnode->next;
     331                                continue;
     332                        }
     333                        //check if tuner is main tuner
     334                        if(getconfig(dvbnode->feshortname, NULL) != NULL)
     335                        {
     336                                dvbnode = dvbnode->next;
     337                                continue;                               
     338                        }
     339                        if(dvbnode->feaktpolarization != tpnode->polarization || dvbnode->feakttransponder->orbitalpos != tpnode->orbitalpos)
     340                        {
     341                                dvbnode = dvbnode->next;
     342                                continue;                               
     343                        }
     344                        found = 0;
     345                        //check looptuner is free
     346                        tmpstr = getconfigbyval(dvbnode->feshortname, NULL);
     347                        CharPtrTmp[0] = NULL;
     348                        while(tmpstr != NULL) //found loop tuner
     349                        {
     350                                tmpdvbnode = fegetbyshortname(tmpstr);
     351                                //if(flag != 1) printf("****** test tuner1 %s -> %s\n", dvbnode->feshortname, tmpdvbnode->feshortname);
     352                                if(tmpdvbnode != NULL && tmpdvbnode->felock == 0)
     353                                {
     354                                        found = 99;
     355                                        break;
     356                                }
     357                                else
     358                                {
     359                                        CharPtrTmp[found] = tmpdvbnode;
     360                                        found = found + 1;
     361                                }
     362                                tmpstr = getconfigbyval(tmpstr, NULL); //loop tuner also loop  ?
     363                        }
     364                        CharPtrTmp[0] = NULL;
     365                        if(found != 99)
     366                        {
     367                                dvbnode = dvbnode->next;
     368                                continue;
     369                        }
     370                        tmpstr = ostrcat(dvbnode->feshortname, "_sat", 0, 0);
     371                        for(i = 1; i <= getmaxsat(dvbnode->feshortname); i++)
     372                        {
     373                                tmpnr = oitoa(i);
     374                                orbitalpos = getconfigint(tmpstr, tmpnr);
     375                                if(orbitalpos == tpnode->orbitalpos)
     376                                {
     377                                        fegetconfig(dvbnode, tpnode, &aktnr, tmpnr);
     378                                        if(flag == 3)
     379                                                band = calclof(dvbnode, tpnode, aktnr, 0);
     380                                        else
     381                                                band = calclof(dvbnode, tpnode, aktnr, 1);
     382                                        found = 0;
     383                                        if(tmpdvbnode != NULL && tmpdvbnode->feaktband != band)
     384                                        {
     385                                                found = -1;
     386                                                break;
     387                                        }
     388                       
     389                                        if(flag == 1)
     390                                        {
     391                                                free(tmpstr); tmpstr = NULL;
     392                                                free(tmpnr); tmpnr = NULL;
     393                                                return tmpdvbnode;
     394                                        }
     395                                        dvbnode->feaktband = band;
     396                                        dvbnode->feaktpolarization = tpnode->polarization;
     397               
     398                                        tmpdvbnode->felasttransponder = tmpdvbnode->feakttransponder;
     399                                        tmpdvbnode->feakttransponder = tpnode;
     400                                        tmpdvbnode->feaktpolarization = tpnode->polarization;
     401                                        free(tmpdvbnode->feaktnr);
     402                                        if(aktnr != NULL)
     403                                                tmpdvbnode->feaktnr = ostrcat(aktnr, NULL, 0, 0);
     404                                        else
     405                                                tmpdvbnode->feaktnr = NULL;
     406
     407                                        free(tmpstr); tmpstr = NULL;
     408                                        free(tmpnr); tmpnr = NULL;
     409                                        if(flag != 1) debug(200, "found free tuner witch same orbitalpos %s", dvbnode->feshortname);
     410                                        if(flag != 1) printf("------ found free loop tuner: %s witch same orbitalpos main tuner: %s\n", tmpdvbnode->feshortname, dvbnode->feshortname);
     411                                        return tmpdvbnode;
     412                                }
     413                                free(tmpnr); tmpnr = NULL;
     414                        }
     415                        free(tmpstr); tmpstr = NULL;
     416                        if(found == -1)
     417                                break;
    306418                }
    307419                dvbnode = dvbnode->next;
     
    406518                                                return dvbnode;
    407519                                        }
    408                                         if(tmpdvbnode != NULL)
     520                                       
     521                                        found = 0;
     522                                        while(CharPtrTmp[found] != NULL)
    409523                                        {
    410                                                 tmpdvbnode->feaktband = band;
    411                                                 tmpdvbnode->feaktpolarization = tpnode->polarization;
     524                                                CharPtrTmp[found]->feaktband = band;
     525                                                CharPtrTmp[found]->feaktpolarization = tpnode->polarization;
     526                                                found = found + 1;
    412527                                        }
     528                                        //if(tmpdvbnode != NULL)
     529                                        //{
     530                                        //      tmpdvbnode->feaktband = band;
     531                                        //      tmpdvbnode->feaktpolarization = tpnode->polarization;
     532                                        //}
    413533                                        dvbnode->felasttransponder = dvbnode->feakttransponder;
    414534                                        dvbnode->feakttransponder = tpnode;
     
    553673                                                return dvbnode;
    554674                                        }
    555                                         if(tmpdvbnode != NULL)
     675                                        found = 0;
     676                                        while(CharPtrTmp[found] != NULL)
    556677                                        {
    557                                                 tmpdvbnode->feaktband = band;
    558                                                 tmpdvbnode->feaktpolarization = tpnode->polarization;
     678                                                CharPtrTmp[found]->feaktband = band;
     679                                                CharPtrTmp[found]->feaktpolarization = tpnode->polarization;
     680                                                found = found + 1;
    559681                                        }
     682                                        //if(tmpdvbnode != NULL)
     683                                        //{
     684                                        //      tmpdvbnode->feaktband = band;
     685                                        //      tmpdvbnode->feaktpolarization = tpnode->polarization;
     686                                        //}
    560687                                        dvbnode->felasttransponder = dvbnode->feakttransponder;
    561688                                        dvbnode->feakttransponder = tpnode;
     
    22212348        {
    22222349                err("FE_SET_PROPERTY failed -> use procfs to switch delivery system tuner %d mode %s type %d",tuner->devnr ,value, type);
     2350        }
    22232351                hypridtuner = getconfig("hypridtuner", NULL);
    22242352                if(hypridtuner != NULL)
     
    22472375                free(buf); buf = NULL;
    22482376                return 1; //true
    2249         }
     2377       
    22502378        return 0; //true
    22512379
Note: See TracChangeset for help on using the changeset viewer.