[mythtv] Re: [mythtv-commits] Re: Ticket #821: autoexpire doesn't

Chris Pinkham cpinkham at bc2va.org
Sun Jan 1 17:31:59 EST 2006


> > Are any of these recordings sticking around and being left un-expired?
> >
> > If so, can you provide the recorded table into to go along with the log?
> >
> > select starttime, endtime from recorded where recgroup = "LiveTV";
> 
> That's the mysql output for both files appearing in my log. Both of
> them are still sticking around in the LiveTV list:
> 
> 2006-01-01 16:01:34     2006-01-01 16:30:00
> 2006-01-01 16:01:45     2006-01-01 16:10:00
> 
> Do you need anything else?

I see two issues I think.

I think your problem with the failed channel change may be in
TVRec::TuningRestartRecorder().  Near the top we have the following:

    if (HasFlags(kFlagDummyRecorderRunning))
    {   
        dummyRecorder->StopRecordingThread();
        ClearFlags(kFlagDummyRecorderRunning);
        FinishedRecording(curRecording);
        curRecording->MarkAsInUse(false);
        had_dummyrec = true;
    }

But in the case of a failed channel change, there wasn't a dummy recorder
running and we still need to finish the old recording if we're going to
start a new one, so we really should be doing these two lines outside of
that if statement and into their own "if (curRecording)" wrapper like this:

    if (HasFlags(kFlagDummyRecorderRunning))
    {   
        dummyRecorder->StopRecordingThread();
        ClearFlags(kFlagDummyRecorderRunning);
        had_dummyrec = true;
    }

    if (curRecording)
    {
        FinishedRecording(curRecording);
        curRecording->MarkAsInUse(false);
    }

Really, in any case where we are restarting the recorder, we should be
finishing up the 

The second issue is the reason why there was a failed channel change.
I think this may be occurring in TV::CommitQueuedInput().  At the bottom of
that method, we have the following code:

        else if (activerecorder->CheckChannel(channum))
            ChangeChannel(GetQueuedChanID(), channum);
        else
            ChangeChannel(GetQueuedChanID(), GetQueuedInput());

So, we check to see if "channum" is a valid channel, and if so we use it,
but if it is not, we just fall through and try to change channels to
whatever is in the queuedInput, which may or may not be a valid channel.

I think the fix for this would be to put a check before the second
ChangeChannel() like this:

        else if (activerecorder->CheckChannel(channum))
            ChangeChannel(GetQueuedChanID(), channum);
        else if (activerecorder->CheckChannel(GetQueuedInput()))
            ChangeChannel(GetQueuedChanID(), GetQueuedInput());

If you could try these two fixes and report back, it would help.

Daniel, if you see this, do these make sense to you?

-- 
Chris



More information about the mythtv-dev mailing list