[mythtv] mythtv blocking/crashing fix
Daniel Thor Kristjansson
danielk at cat.nyu.edu
Fri Jan 30 00:54:27 EST 2004
The frontend is blocking forever when I tune into an off-air hdtv
channel. This patch exits mythtv after about 20 seconds of no input and
returns to mythtvfrontend.
I also have a fix that makes the httv backend a little more robust but
I'm still looking at how to tune it.
Please try this if you have a hdtv card, or you've had this problem
with another capture card.
Also, if someone familiar with the RingBuffer and tv_play has some time,
I'd like it if you look at this, this my first attempt hacking Myth and
I may have missed something.
-- Daniel
-------------- next part --------------
Index: libs/libmythtv/RingBuffer.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythtv/libs/libmythtv/RingBuffer.cpp,v
retrieving revision 1.90
diff -r1.90 RingBuffer.cpp
814a815
> int readErr=0;
819c820
< if (!availWait.wait(&availWaitMutex, 2000))
---
> if (!availWait.wait(&availWaitMutex, 2000)) {
821a823,831
> readErr++;
> if (readErr>5) {
> cerr << "Waited 10 seconds for data to become available, aborting" << endl;
> wanttoread=0;
> stopreads=true;
> availWaitMutex.unlock();
> return 0;
> }
> }
Index: libs/libmythtv/tv_play.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythtv/libs/libmythtv/tv_play.cpp,v
retrieving revision 1.149
diff -r1.149 tv_play.cpp
605a606,614
> if (!activenvp->IsDecoderThreadAlive() && kState_None!=nextState) {
> cerr<<"panic: decoder not alive and state not None"<<endl;
> if (kState_WatchingLiveTV==nextState) {
> cerr<<"stopping recorder"<<endl;
> StopPlayerAndRecorder(false, true);
> recorder=false;
> }
> tmpInternalState=kState_None;
> }
More information about the mythtv-dev
mailing list