[mythtv] [PATCH] Workaround for hangs when ffwd/rewinding video

Matt Holgate matt-bulk-mythtv at holgate.org.uk
Wed Sep 20 19:58:44 UTC 2006


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 

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 
#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)

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 

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. If you think it seems sensible, I'll open a 
ticket and submit it properly. Feedback please :)

thanks a lot,
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch.txt
Url: http://mythtv.org/pipermail/mythtv-dev/attachments/20060920/7b84c2ef/attachment.txt 

More information about the mythtv-dev mailing list