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

MythTV mythtv at cvs.mythtv.org
Thu Sep 21 10:02:25 UTC 2006


#2434: Workaround for hangs when ffwd/rewinding video
---------------------------------------------+------------------------------
 Reporter:  matt-bulk-mythtv at holgate.org.uk  |       Owner:  ijr    
     Type:  patch                            |      Status:  new    
 Priority:  major                            |   Milestone:  unknown
Component:  mythtv                           |     Version:  0.20   
 Severity:  medium                           |  
---------------------------------------------+------------------------------
 I'm running myth-0.20-fixes on a VIA EPIA M10000 box, and I get regularly
 get hangs while fast forwarding/rewinding videos (live tv or recorded).

 It seems to happen when seeking then resuming playback. In the logs I get
 loads of messages like:

 2006-09-20 20:40:27.917 Waited too long for video out to pause

 I've seen other people point out this issue too. Tracing it back, it seems
 to be getting stuck in PauseVideo():

 {{{
 #0  0xb5df3440 in pthread_cond_timedwait@@GLIBC_2.3.2 () from
 /lib/tls/libpthread.so.0
 #1  0xb64e04e0 in QWaitCondition::wait () from /usr/lib/libqt-mt.so.3
 #2  0xb792fcba in NuppelVideoPlayer::PauseVideo (this=0x8f32db0,
 wait=true)
     at NuppelVideoPlayer.cpp:456
 #3  0xb7943448 in NuppelVideoPlayer::StartPlaying (this=0x8f32db0)
     at NuppelVideoPlayer.cpp:3317
 #4  0xb78deedf in SpawnDecode (param=0x8f32db0) at tv_play.cpp:256
 #5  0xb5df0b63 in start_thread () from /lib/tls/libpthread.so.0
 #6  0xb5ca918a in clone () from /lib/tls/libc.so.6
 }}}

 I think what is happening is that the seeking operation is trying to pause
 the video:

 {{{
            if (fftime >= 5)
             {
                 PauseVideo();
 }}}

 but there is a race between PauseVideo() setting the pausevideo member to
 true:

 {{{
 void NuppelVideoPlayer::PauseVideo(bool wait)
 {
     video_actually_paused = false;
     pausevideo = true;
 }}}

 and the user pressing 'play' causing pausevideo to become false in
 UnpauseVideo()

 {{{
 void NuppelVideoPlayer::UnpauseVideo(void)
 {
     pausevideo = false;
 }
 }}}
 I think this is causing PauseVideo to get stuck in an infinite loop will
 trying to seek.

 I've attached a patch which works around this, but I've no idea if it's
 the correct thing to do. Feedback please :)

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


More information about the mythtv-commits mailing list