[mythtv-commits] Ticket #2434: Workaround for hangs when ffwd/rewinding video

MythTV mythtv at cvs.mythtv.org
Sun Apr 29 12:40:20 UTC 2007


#2434: Workaround for hangs when ffwd/rewinding video
---------------------------------------------+------------------------------
 Reporter:  matt-bulk-mythtv at holgate.org.uk  |        Owner:  danielk
     Type:  defect                           |       Status:  new    
 Priority:  minor                            |    Milestone:  0.21   
Component:  mythtv                           |      Version:  head   
 Severity:  medium                           |   Resolution:         
---------------------------------------------+------------------------------

Comment(by Matt Holgate <matt-bulk-mythtv at holgate.org.uk>):

 Daniel, thanks for the new patch, and sorry to take so long to get back to
 you.

 Anyway, I've tested the patch, and unfortunately it still doesn't fix the
 problem I was seeing. I have produced a modified version which I think
 /does/ fix it, at least in my limited testing so far.

 The problem was that even though 'video_actually_paused' and 'pausevideo'
 are now protected by the pauseUnpauseLock, the original race can still
 occur given the following sequence of events:

    * ffwd/rewind code tries to pause the video by calling PauseVideo().
 PauseVideo() waits on the condition variable for the video to /actually/
 pause, meanwhile releasing the pauseUnpauseLock.
    * user presses 'play', resulting in UnpauseVideo() being called. This
 thread is able to get the pauseUnpauseVideo lock, and pauseVideo is set to
 false.
    * Since 'pauseVideo' is now false, the video is never actually paused,
 and the ffwd/rewind code is not able to proceed.

 The fix I have made adds an additional lock 'internalPauseLock'. This
 ensures that any internally generated (e.g. from the seeking code),
 {Pause/Do something/Unpause} sequences are now atomic with respect to any
 user initiated pause/play operations. This means that an internally
 generated pause cannot ever interact badly with a user-generated one.

 I've only briefly tested this patch, but I'll leave it running for the
 next few days to see how it fares. Any feedback really welcome, as it'd be
 great to get this one closed.

-- 
Ticket URL: <http://svn.mythtv.org/trac/ticket/2434#comment:23>
MythTV <http://svn.mythtv.org/trac>
MythTV


More information about the mythtv-commits mailing list