Ticket #344: eit.2.patch

File eit.2.patch, 4.3 KB (added by John Pullan <john.pullan@…>, 19 years ago)

Slight miskate in the patch (oops)

  • sitypes.h

     
    238238    QString loadStatus();
    239239
    240240    int AddSection(tablehead *head);
     241    bool isEmpty() { return Empty; }
    241242
    242243private:
    243244    int16_t MaxSections;       // Max number of sections
    244245    int8_t  Version;           // Table Version
    245246    uint8_t Filled[0x100];     // Fill status of each section
     247    bool    Empty;             // Any entries ?
    246248};
    247249
    248250// Tables to hold Actual Network Objects
  • sitypes.cpp

     
    9292{
    9393    MaxSections = -1;
    9494    Version = -1;
     95    Empty = true;
    9596    memset(&Filled, 0, sizeof(Filled));
    9697}
    9798
     
    136137
    137138int SectionTracker::AddSection(tablehead *head)
    138139{
     140    Empty = false;
    139141    if (MaxSections == -1)
    140142    {
    141143         MaxSections = head->section_last;
     
    797799    status[key].requested = true;
    798800    status[key].requestedEmit = true;
    799801    status[key].emitted = false;
     802    status[key].pulling = true;
    800803}
    801804
    802805bool EventHandler::EmitRequired()
     
    814817        if (!(sttloaded))
    815818            return false;
    816819    }
     820
    817821    if (!(servicesloaded))
     822    {
     823#ifdef EIT_DEBUG_SID
     824        static int n =0;
     825        if (!(n++%100))
     826            printf("EventHandler::EmitRequired no services\n");
     827#endif
    818828        return false;
     829    }
    819830
    820831    for (s = status.begin() ; s != status.end() ; ++s)
    821832    {
     833#ifdef EIT_DEBUG_SID
     834        if (s.key()==EIT_DEBUG_SID)
     835        {
     836            if (s.data().emitted || !s.data().pulling)
     837                 printf("EventHandler::EmitRequired %d: tracker not pulling\n",EIT_DEBUG_SID);
     838        }
     839#endif
    822840        if (s.data().emitted || !s.data().pulling)
    823         {
    824841            continue;
    825         }
    826842
     843        if (TrackerSetup[s.key()] == false)
     844            continue;
    827845        AllComplete = true;
    828846        /* Make sure all sections are being pulled otherwise your not done */
    829         if (TrackerSetup[s.key()] == false)
    830             AllComplete = false;
    831847        for (i = Tracker[s.key()].begin() ; i != Tracker[s.key()].end() ; ++i)
    832848        {
    833849            if (!i.data().Complete())
    834850            {
     851#ifdef EIT_DEBUG_SID
     852                if (s.key()==EIT_DEBUG_SID)
     853                    printf("EventHandler::EmitRequired %d: 0%x is not complete\n",EIT_DEBUG_SID,i.key());
     854#endif
    835855                AllComplete = false;
    836856                break;
    837857            }
    838858        }
    839         if (SIStandard == SI_STANDARD_ATSC)
     859        if (AllComplete && (SIStandard == SI_STANDARD_ATSC))
    840860        {
    841861            for (e = Events[s.key()].begin() ; e != Events[s.key()].end() ; ++e)
    842862            {
     
    857877                }
    858878            }
    859879        }
     880#ifdef EIT_DEBUG_SID
     881        if (s.key()==EIT_DEBUG_SID)
     882            printf("EventHandler::EmitRequired (End) %d: AllComplete=%d\n",EIT_DEBUG_SID,AllComplete);
     883#endif
    860884        if (AllComplete)
    861885            return true;
    862886    }
     
    877901        {
    878902            AllComplete = true;
    879903            if (TrackerSetup[s.key()] == false)
    880                 AllComplete = false;
     904                continue;
    881905            /* Make sure all sections are being pulled otherwise your not done */
    882             for (i = Tracker[s.key()].begin() ; i != Tracker[s.key()].end() ; ++i)
     906            for (i = Tracker[s.key()].begin(); i != Tracker[s.key()].end(); ++i)
    883907            {
    884908                if (!(i.data().Complete()))
     909                {
    885910                    AllComplete = false;
     911                    break;
     912                }
    886913            }
    887             if (SIStandard == SI_STANDARD_ATSC)
     914
     915            if (AllComplete && (SIStandard == SI_STANDARD_ATSC))
    888916            {
    889917                for (e = Events[s.key()].begin() ; e != Events[s.key()].end() ; ++e)
    890918                {
     
    967995    }
    968996#endif
    969997
     998    //If we are interested in this but the tracker does not have any data
     999    //in it then set the status back to pulling if appropriate
     1000    if (status[key0].requestedEmit && Tracker[key0][key1].isEmpty() &&
     1001        status[key0].emitted)
     1002    {
     1003        status[key0].pulling = true;
     1004        status[key0].emitted = false;
     1005    }
     1006
    9701007    if (SIStandard == SI_STANDARD_ATSC)
    9711008    {
    9721009        QMap_pidHandler::Iterator p;