[mythtv] [mythtv-commits] Ticket #1120: Live->recording fails to stop at the endtime if playback continues.

Isaac Richards ijr at case.edu
Thu Jan 26 04:46:18 UTC 2006


On Wednesday 25 January 2006 19:41, MythTV wrote:
> #1120: Live->recording fails to stop at the endtime if playback continues.
> --------------------+------------------------------------------------------
>- Reporter:  bjm     |       Owner:  danielk
>      Type:  defect  |      Status:  new
>  Priority:  minor   |   Milestone:  0.19
> Component:  mythtv  |     Version:  head
>  Severity:  medium  |
> --------------------+------------------------------------------------------
>- To reproduce, enter live TV and change channels to a program that is about
> to end. Press "R". Continue watching until after the end time of the
> program. The recording continues in the same file and with the same program
> information rather than starting a new file for the show that follows.

Think I found it, but Daniel needs to confirm, since he broke it: =)

tv_rec.cpp, line 1218:

            if (pseudoLiveTVRecording &&
                (QDateTime::currentDateTime() > recordEndTime ||
                 HasFlags(kFlagFinishRecording)))
            {
                SetPseudoLiveTVRecording(NULL);
                enable_livetv_ui = true;
            }
            else if (curRecording &&
                     !pseudoLiveTVRecording && !pendingRecording)
            {
//#define TESTING_RING_BUFFER_SWITCHING
#ifdef TESTING_RING_BUFFER_SWITCHING
                if ((QDateTime::currentDateTime() >=
                     curRecording->recstartts.addSecs(60)))
#else
                if ((QDateTime::currentDateTime() >= curRecording->endts))
#endif
                {
                    CheckForRecGroupChange();
                    if (pseudoLiveTVRecording)
                    {
                        // If the last recording was flagged for keeping
                        // in the frontend, then add the recording rule
                        // so that transcode, commfrag, etc can be run.
                        recordEndTime =
                            GetRecordEndTime(pseudoLiveTVRecording);
                        NotifySchedulerOfRecording(curRecording);
                    }
                    else
                    {
                        SwitchLiveTVRingBuffer();
                        enable_livetv_ui = true;
                    }
                }
            }

Basically, it looks like the first time through that bit of code, the first if 
triggers, and it calls SetPseudoLiveTVRecording(NULL).  Drops through the 
rest of the loop, sends a message to the frontend that it's switching back to 
regular live-tv.  Doesn't change the ringbuffer.

Next time through, the first if misses, and it hits the second two ifs, (if 
currenttime > endts).  CheckForRecGroupChange(), when it gets called checks 
the current recording (ie, what should be over now), notices that it's not a 
'LiveTV' program, and re-sets's SetPseudoLiveTVRecording to the old 
recording.  The code above skips the ringbuffer switch in that case.

Rinse, repeat.  And repeat, and repeat, and repeat.  Looks like it'll never 
hit the code to switch ringbuffers.

Look right?  Just inspecting the code, didn't actually test things. =)

Isaac


More information about the mythtv-dev mailing list