Opened 15 years ago

Closed 15 years ago

#3004 closed patch (fixed)

LiveTV -> 'watch as it records' failure

Reported by: danielk Owned by: danielk
Priority: minor Milestone: 0.21
Component: mythtv Version: head
Severity: low Keywords:
Cc: Ticket locked: no


Switching from LiveTV into watching a scheduled recording as it records on another channel sometimes fails. This was reported by Jim Westfall and thought it was related to Firewire recording, but it turned out to be a general race condition.

We've both been running with a fix in our trees which seems to work. I'm creating a patch in case someone else wants to test this before it goes into svn head.

Attachments (1)

3004-v2.patch (703 bytes) - added by danielk 15 years ago.

Download all attachments as: .zip

Change History (2)

Changed 15 years ago by danielk

Attachment: 3004-v2.patch added

comment:1 Changed 15 years ago by danielk

Resolution: fixed
Status: newclosed

(In [12675]) Fixes #3004. Fixes race with "Watch as it records".

If scheduler wants to use the recorder you are watching LiveTV on and you decide to watch as it records, there can be a race with normal end of program ringbuffer switching. If the program you are watching ends while the scheduler is running the code in StartRecording? and is on line 463 (the event flush), then the ring buffer switch for the next program will be started, but if the recorder is a digital recorder and has not found a keyframe before StartRecording? gets to line 533 then the ringbuffer change for the scheduled recording will partially overwrite the in flight ringbuffer switch.

This change avoids this race by moving the delete of the pendingRecording until after the new scheduled recording is setup so that the normal end of program ringbuffer switching is not triggered while StartRecording? is running.

Note: See TracTickets for help on using tickets.