Changeset 18542


Ignore:
Timestamp:
11/11/12 15:41:45 (11 years ago)
Author:
nit
Message:

[titan] add getepgnext

Location:
titan/titan
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • titan/titan/epg.h

    r18541 r18542  
    5151        if(chnode == NULL) return;
    5252        if(epgnode == NULL) epgnode = getepgakt(chnode);
     53        if(epgnode == NULL) epgnode = getepgnext(chnode);
    5354        tmpepg = epgnode;
    5455       
     
    194195        if(chnode == NULL) return;
    195196        if(epgnode == NULL) epgnode = getepgakt(chnode);
     197        if(epgnode == NULL) epgnode = getepgnext(chnode);
    196198
    197199        status.epgchannel = chnode;
     
    690692}
    691693
     694struct epg* getepgnext(struct channel* chnode)
     695{
     696        debug(1000, "in");
     697        time_t akttime = time(NULL);
     698
     699        m_lock(&status.epgmutex, 4);
     700
     701        if(chnode == NULL || chnode->epg == NULL)
     702        {
     703                debug(1000, "out-> NULL detect");
     704                m_unlock(&status.epgmutex, 4);
     705                return NULL;
     706        }
     707
     708        struct epg *node = chnode->epg;
     709
     710        while(node != NULL)
     711        {
     712                if(node->starttime >= akttime)
     713                {
     714                        debug(1000, "out");
     715                        m_unlock(&status.epgmutex, 4);
     716                        return node;
     717                }
     718
     719                node = node->next;
     720        }
     721
     722        m_unlock(&status.epgmutex, 4);
     723        return NULL;
     724}
     725
    692726struct epg* getepgakt(struct channel* chnode)
    693727{
  • titan/titan/gmultiepg.h

    r18431 r18542  
    141141
    142142                        epgnode = getepgakt(tmpchannel);
     143                        if(epgnode == NULL) epgnode = getepgnext(tmpchannel);
    143144
    144145                        while(epgnode != NULL)
  • titan/titan/header.h

    r18431 r18542  
    727727
    728728//epg.h
     729struct epg* getepgnext(struct channel* chnode);
    729730void screensingleepg(struct channel* chnode, struct epg* epgnode, int flag);
    730731void screenepg(struct channel* chnode, struct epg* epgnode, int flag);
  • titan/titan/multiepg.h

    r18431 r18542  
    1010
    1111        epgnode = getepgakt(curchannel);
     12        if(epgnode == NULL) epgnode = getepgnext(curchannel);
    1213                       
    1314        while(epgnode != NULL){
Note: See TracChangeset for help on using the changeset viewer.