[mythtv] Possible bug when using override with postroll

Chris Pinkham cpinkham at bc2va.org
Wed Nov 12 01:06:13 EST 2003


> Already started.  I wasn't going to commit anything though, before who
> does what was resolved.  I will probably be a couple of hours since I
> will try to test each thing affected.

In looking at your mods, it appears this will also fix a problem I was seeing
with another mod sitting in my source tree.

For a while we've wanted to change Myth to name the file with the time the
recording actually started.  Once we do this, if a backend is restarted
for whatever reason and a recording re-starts, the file for the 2nd half
will not overwrite the file for the first half since they will have different
starttimes.

I added this functionality by adding a few lines to scheduler.cpp before
nexttv->StartRecording(nextRecording) is called so it looks like this:
(NOTE this is the old code, new code has recstartts instead of startts)

                nextRecording->startts = QDateTime::currentDateTime();
                nextRecording->startts.setTime(QTime(
                                       nextRecording->startts.time().hour(),
                                       nextRecording->startts.time().minute()));

                if (nexttv->StartRecording(nextRecording))
                    msg = "Started recording";
                else
                    msg = "Canceled recording";

Problem was that if anything caused the scheduler to recompute (such as a
new recording being scheduled or a backend (dis)connecting, the scheduler would
try to fire off another record for the same show because PruneList wasn't
seeing that the show was already being recorded because the start times
differed.  With your changes, the start times would always be the same so it
wouldn't fire off a 2nd copy if the first recording was active, but the
files will get named unique if the recording was stopped and restarted.

I changed the 'startts' entries above to recstartts and that will force
the filename to be correct as well as the actual start time for the recorded
and oldrecorded tables.  On normal shows that start on time, recstartts
will just be set to the current time (which should be equal to what it is
currently set at since the recording wouldn't be starting otherwise).  If
a show starts late for some reason, recstartts will be set to the time it
actually starts.  The code above sets the date, hour, and minute but leaves
the seconds set to 0 so it matches everything else.

Once the pre/postroll <-> overrides interaction is worked out and committed,
I'll test this again and get it committed as well.

-- 

Chris



More information about the mythtv-dev mailing list