[mythtv] Now/Next DVB EPG info

William Uther willu.mailingLists at cse.unsw.edu.au
Mon Feb 14 12:17:48 UTC 2005

Hi all,

   I realise that there is much 0.17 noise at the moment.  Feel free to 
give this email a lower priority.  :)

   I've been looking at having MythTV merge the DVB Now/Next show EPG 
information into the database.  Below is my current plan, and I thought 
I'd post here to see if it seems reasonable (this is my first bit of 
Myth hacking).

  1) Make the siparser grab the current and next program information and 
hand it on...


 >               case 0x4E: /* current program */
 >               case 0x4F: /* next program */
 >             if ((head->table_id == 0x4E) || (head->table_id == 0x4F))
 >             {
 >                 ((EventHandler*) 
 >                 ((EventHandler*) 
 >             }

(Note that I see no reason why a patch like this one couldn't go in 
already.  I say "like this one" because I haven't actually tested this 
one myself yet.  There was an earlier patch posted to this list that 
did similar things.  It didn't have the Reset() lines.  Are these 
needed or have I misunderstood something here?)

  2) Adjust the prefs to that the "on air guide" can be on at the same 
time as xmltv (channelsettings.cpp, lines 275 and 304)

  3) Merge the new events into the database rather than just ignoring 
them. (siscan.cpp around line 997)
   I was assuming something like this during the code to process on air 
guide events:

   // find all programs in the DB with either start time -2 to +1 hours 
of this event (assuming shows are more likely to be delayed than moved 
forward) on the same channel
   // loop through them looking for a match
     //longest common substring in title - if over 50% of shorter 
string, then it is a match
     //overlapping time - if multiple title matches, most overlap in 
time is best match
   // if no title matches then insert duplicate entry in program table, 
increment counter
   // else take best match and see if start and end times have changed
     // if so, correct them and increment counter

(the counter I was referring to above is a counter in the current code 
that marks when changes have been made to the DB and the scheduler 
needs to be re-run.)

   This algorithm would occasionally leave gaps in the EPG.  I assume 
that is no big issue.  It might also occasionally cause overlaps in the 
EPG.  Is that going to cause a problem?

  4) I think I also need to change things so that siscan is called 
regularly.  Not sure where this is called from yet, or what the best 
schedule is.  Two options I'm considering:
    - Every 30 mins loop through the channels (just long enough to get 
Now/Next info)
    - Half way through the show prior to any scheduled recording, scan 
for Now/Next info

Any thoughts or suggestions?

Will          :-}

Dr William Uther                           National ICT Australia
Phone: +61 2 9385 6357               Computer Science and Engineering
Email: willu at cse.unsw.edu.au          University of New South Wales
Web: http://www.cse.unsw.edu.au/~willu/     Sydney, Australia

More information about the mythtv-dev mailing list