Changeset 11801


Ignore:
Timestamp:
11/28/11 20:40:58 (12 years ago)
Author:
nit
Message:

[titan] fix subchannel

Location:
titan/titan
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • titan/titan/epg.h

    r11722 r11801  
    895895       
    896896        transponderid = (onid << 16) | tid;
    897        
     897
    898898        if(getlinkedchannel(chnode, serviceid, transponderid) == NULL)
    899899                addlinkedchannel(chnode, serviceid, transponderid, NULL);
     
    10301030
    10311031//Parse Descriptor
    1032 void parseeitdesc(struct channel* chnode, struct epg* epgnode, unsigned char *buf, int len)
    1033 {
    1034         //int pds = 0;
    1035 
     1032void parseeitdesc(struct channel* chnode, struct epg* epgnode, unsigned char *buf, int len, int onlylinkedchannel)
     1033{
    10361034        unsigned char *p;
    10371035        for(p = buf; p < buf + len; p += 2 + p[1])
    10381036        {
     1037                if(onlylinkedchannel == 1 && (int)p[0] != 0x4A) continue;
    10391038                switch((int)p[0])
    10401039                {
     
    11101109        unsigned long transponderid = 0;
    11111110        int serviceid = 0, eventid = 0;
     1111        int onlylinkedchannel = 0;
    11121112
    11131113        len -= 4; //remove CRC
     
    11171117        for (p = (unsigned char*)&eit->data; p < buf + len; p += EITEVENTLEN + GETEITDESCLEN(p))
    11181118        {
     1119                onlylinkedchannel = 0;
    11191120                struct eitevent* evt = (struct eitevent*)p;
    11201121
     
    11511152                        {
    11521153                                m_unlock(&status.epgmutex, 4);
    1153                                 continue;
    1154                         }
    1155                         delepg(tmpchnode, eventid, 1);
     1154                                onlylinkedchannel = 1;
     1155                        }
     1156                        else
     1157                                delepg(tmpchnode, eventid, 1);
    11561158                }
    11571159
     
    11741176#endif
    11751177
    1176                 epgnode = addepg(tmpchnode, eventid, eit->version_number, starttime, endtime, NULL, 1);
    1177                 if(epgnode == NULL)
    1178                 {
    1179                         debug(1000, "out -> NULL detect");
    1180                         m_unlock(&status.epgmutex, 4);
    1181                         continue;
     1178                if(onlylinkedchannel == 0)
     1179                {
     1180                        epgnode = addepg(tmpchnode, eventid, eit->version_number, starttime, endtime, NULL, 1);
     1181                        if(epgnode == NULL)
     1182                        {
     1183                                debug(1000, "out -> NULL detect");
     1184                                m_unlock(&status.epgmutex, 4);
     1185                                continue;
     1186                        }
    11821187                }
    11831188
     
    11851190                //printf("RunningStatus %d\n", evt->running_status);
    11861191
    1187                 parseeitdesc(tmpchnode, epgnode, (unsigned char*)&evt->data, eitlen);
     1192                parseeitdesc(tmpchnode, epgnode, (unsigned char*)&evt->data, eitlen, onlylinkedchannel);
    11881193                //compress long desc
    1189                 if(epgnode->desc != NULL)
     1194                if(onlylinkedchannel == 0 && epgnode->desc != NULL)
    11901195                {
    11911196                        ret = zip(epgnode->desc, strlen(epgnode->desc) + 1, &zbuf, &zlen, 1);
  • titan/titan/linkedchannel.h

    r11723 r11801  
    5454        listbox->aktpage = -1;
    5555
     56        addscreenrc(linkedchannel, listbox);
     57start:
     58        tmp = NULL;
     59        delmarkedscreennodes(linkedchannel, 1);
    5660        if(status.aktservice->channel != NULL)
    5761        {
     
    6367                        if(chnode != NULL)
    6468                        {
     69                                epgnode = getepgakt(chnode);
     70                                //don't show linked channel with start/end 1day
     71                                if(epgnode != NULL && epgnode->endtime - epgnode->starttime >= 86400)
     72                                {
     73                                        node = node->next;
     74                                        continue;
     75                                }
    6576                                tmp = addlistbox(linkedchannel, listbox, tmp, 1);
    6677                                if(tmp != NULL)
    6778                                {
    6879                                        tmpstr = ostrcat(tmpstr, chnode->name, 1, 0);
    69                                         epgnode = getepgakt(chnode);
    7080                                        if(epgnode != NULL)
    7181                                        {
     
    7787                                        tmp->handle = (char*)node;
    7888                                        tmp->handle1 = (char*)chnode;
    79 
    80 /*
    81                                         tmp->type = CHOICEBOX;
    82                                         if(status.aktservice->channel->audiopid == node->audiopid)
    83                                                 changeinput(tmp, _("running"));
    84                                         else
    85                                                 changeinput(tmp, "");
    86 */
    8789                                }
    8890                        }
     
    9395
    9496        drawscreen(linkedchannel, 0);
    95         addscreenrc(linkedchannel, listbox);
    9697
    9798        while(1)
    9899        {
    99                 rcret = waitrc(linkedchannel, 0, 0);
     100                rcret = waitrc(linkedchannel, 2000, 0);
     101       
     102                if(rcret == RCTIMEOUT) goto start;
    100103       
    101104                if(rcret == getrcconfigint("rcexit", NULL)) break;
     
    106109                                m_lock(&status.linkedchannelmutex, 14);
    107110                                if(checklinkedchannel(status.aktservice->channel, (struct linkedchannel*)listbox->select->handle) != NULL)
     111                                {
     112                                        m_unlock(&status.linkedchannelmutex, 14);
    108113                                        servicecheckret(servicestart((struct channel*)listbox->select->handle1, NULL, NULL, 0), 0);
    109                                 m_unlock(&status.linkedchannelmutex, 14);
     114                                }
     115                                else
     116                                        m_unlock(&status.linkedchannelmutex, 14);
    110117                        }
    111118                        break;
Note: See TracChangeset for help on using the changeset viewer.