[mythtv-commits] Ticket #11399: EIT scanner causes unnecessary reschedules and prevents idle shutdown

MythTV noreply at mythtv.org
Wed Feb 6 11:22:35 UTC 2013


#11399: EIT scanner causes unnecessary reschedules and prevents idle shutdown
-----------------------------------+----------------------------
 Reporter:  Roger James <roger@…>  |          Owner:  stuarta
     Type:  Patch - Bug Fix        |         Status:  new
 Priority:  minor                  |      Milestone:  0.26.1
Component:  MythTV - EIT           |        Version:  0.26-fixes
 Severity:  medium                 |     Resolution:
 Keywords:  eit idle               |  Ticket locked:  0
-----------------------------------+----------------------------

Comment (by Roger James <roger@…>):

 I am currently working on a new version of the patch. I will make sure I
 use the enum for tableids. I plan to change IsNewEit to handle the
 migration of an eventid down through the range of schedule table ids more
 thoroughly. This means reverting to the original layout of the cache. The
 code now looks something like this.


 {{{
     if (it != eventMap->end())
     {
         uint cached_tableid = extract_table_id(*it);
         uint cached_version = extract_version(*it);
         uint cached_endtime = extract_endtime(*it);
         if ((TableID::PF_EIT == tableid) || (TableID::PF_EITo == tableid))
         {
             // tableid is for PF table
             if ((TableID::PF_EIT == cached_tableid) || (TableID::PF_EITo
 == cached_tableid))
             {
                 // Already seen a PF table so check version
                 // and update if it has changed
                 if ((kVersionInvalid == cached_version) ||
                        (cached_version < version) ||
                        ((kVersionMax == cached_version) && (version <
 kVersionMax)))
                 {
                     verChgCnt++;
                     if (cached_endtime != endtime)
                         bEventMayCauseReschedule = true;
                 }
                 else
                 {
                     // EIT data previously seen
                     hitCnt++;
                     return false;
                 }
             }
         }
         else
         {
             // tableid is for SC table
             if ((cached_tableid & 0x0f) == (tableid & 0x0f))
             {
                 // Already seen this segment of the table so check version
                 // and update if it has changed
                 if ((kVersionInvalid == cached_version) ||
                        (cached_version < version) ||
                        ((kVersionMax == cached_version) && (version <
 kVersionMax)))
                 {
                     verChgCnt++;
                     if (cached_endtime != endtime)
                         bEventMayCauseReschedule = true;
                 }
                 else
                 {
                     // EIT data previously seen
                     hitCnt++;
                     return false;
                 }
             }
         }
     }
     else
         bEventMayCauseReschedule = true;

     eventMap->insert(eventid, construct_sig(tableid, version, endtime,
 true));
     entryCnt++;

     return true;
 }}}
 I am assuming that the same table version number will be used when the
 table is broadcast in an "other transport" table. I wonder if anyone can
 confirm this.

 The IsNewEIT function now returns an "Event may cause schedule change
 flag" in its parameters. This flag will be set to true for new events and
 events where the endtime has changed from the one stored in the map. Of
 course this will miss events where the event has been shortened by
 changing the start time, to catch this we would need to store starttime
 and duration.

 Any comments would be most welcome.

 I have looked at the changesets done on head and they look fine.

 For selfish reasons I will stick with 0.26-fixes for the time being. After
 I have tested the new version of eitcache.cpp the next thing will be to
 look at the MayCauseScheduleChange flag I am now returning and see if I
 can extend the check I do for relevant recording rules so that we always
 update the database but only do reschedules when the flag has been set and
 a rule is relevant.

 Roger

 Roger

-- 
Ticket URL: <http://code.mythtv.org/trac/ticket/11399#comment:3>
MythTV <http://code.mythtv.org/trac>
MythTV Media Center


More information about the mythtv-commits mailing list