[mythtv] Conflict resolution bug.

David Watson dwatson at eecs.umich.edu
Thu Jun 12 17:39:25 EDT 2003


I'm able to reproduce the bug i saw (half hour recording of an
hour long show), but I'm not sure why it hasn't been seen before.

Setup:

Program A: Has a subtitle and description, but subtitle is one
character long, so it will always try to tape.  Half hour long,
first available slot is 9-9:30.

Program B: Has 3 possible recording times.  Hour long, first
available slot is 9-10.

So, the first time around, the one instance of B that doesn't
conflict is set to record, and A tapes at 9.  At 9:30 A finishes
and sets the changed flag in the database.  The scheduler
re-computes the schedule, the 9-10 instance of B no longer conflicts
so it's chosen.  But, it's 9:30 so only half the show is recorded,
and without intervention it won't be recorded again because future
episodes are duplicates.

I've included the first part of a patch to fix the problem.
Unfortunately there's another problem with iterator j, it's being
incremented twice.  So, after deleting the first element of the
list, it loops around until it gets back to i and deletes i
(which equals j).  Unfortunately I don't understand STL well
enough to fix the problem.  Hopefully it's obvious to somebody
else.

David


Index: programs/mythbackend/scheduler.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythtv/programs/mythbackend/scheduler.cpp,v
retrieving revision 1.24
diff -u -r1.24 scheduler.cpp
--- programs/mythbackend/scheduler.cpp  21 May 2003 01:10:24 -0000      1.24
+++ programs/mythbackend/scheduler.cpp  12 Jun 2003 19:43:04 -0000
@@ -378,7 +378,8 @@
                     }
                     else if (first->IsSameProgram(*second))
                     {
-                        if (second->conflicting && !first->conflicting)
+                        if ((second->conflicting && !first->conflicting) ||
+                           second->startts < QDateTime::currentDateTime())
                         {
                             delete second;
                             deliter = j.base();


More information about the mythtv-dev mailing list