[mythtv] Two scheduler queries when "Expiring Program", and two "Finished recording" messages

Chris Pinkham cpinkham at bc2va.org
Sat Mar 3 08:54:11 UTC 2007

* On Sat Mar 03, 2007 at 12:02:06AM -0800, Bruce Markey wrote:
> The finished recording message appear twice but I think that
> is just the result of two verbose messages being hit along
> the way. I don't think it duplicates post recording tasks.

I knew I remembered tracking this down once, so I took another
quick look at the code and found out where it is happening.

Here's the relevant logs from mythbackend after I inserted a
few debug statements where I thought the two calls to
TVRec::FinishedRecording() were occurring:

2007-03-03 03:32:00.771 Calling FinishedRecording in TVRec::TuningShutdowns
2007-03-03 03:32:00.779 Finished recording Home Improvement "The Flirting Game": channel 1002
2007-03-03 03:32:00.780  Called FinishedRecording in TVRec::TuningShutdowns

2007-03-03 03:32:01.170 Calling FinishedRecording in TVRec::TeardownRecorder
2007-03-03 03:32:01.177 Finished recording Home Improvement "The Flirting Game": channel 1002
2007-03-03 03:32:01.177  Called FinishedRecording in TVRec::TeardownRecorder

In TVRec::HandleStateChange we have the following code:

    else if (TRANSITION(kState_RecordingOnly, kState_None))

So we queue up a kFlagCloseRec request.

In TVRec::TuningShutdowns, we have this:

        if (request.flags & kFlagCloseRec)

and in TVRec::TeardownRecorder we have this:

    if (curRecording)

So, we do call TVRec::FinishedRecording twice when a recording ends,
but at 3:50AM it's not the best time for me to be debugging this. :)

TVRec::FinishedRecording() calls ProgramInfo::FinishedRecording()
which in turn calls ScheduledRecording::doneRecording() which is
what prints out the "Finished recording" message.


More information about the mythtv-dev mailing list