[mythtv] [mythtv-commits] Ticket #5870: Channel Change Script Timeout Patch

Doug Haber doug at fawnanddoug.com
Sun Nov 2 12:41:01 UTC 2008

> -----Original Message-----
> From: Michael T. Dean [mailto:mtdean at thirdcontact.com]
> Sent: Saturday, November 01, 2008 11:42 AM
> To: mythtv-dev at mythtv.org
> Subject: Re: [mythtv-commits] Ticket #5870: Channel Change Script
> Timeout Patch
> On 10/31/2008 07:41 PM, MythTV wrote:
> > #5870: Channel Change Script Timeout Patch
> >
> >  I was having a problem where my channel change script was sometimes
> taking
> >  longer than 30 seconds (firewire resync issues) and so some
> recordings
> >  would get missed. This could have been avoided if I had a way to
> increase
> >  the channel change timeout to something greater than 30 seconds.
> >
> You can also background the channel-change script.  It looks like you
> should be able to just add " &" to the end of the "External channel
> change command" value, but worst-case scenario, you can have Myth call
> a
> script that calls and backgrounds the real script.  Then Myth thinks
> the
> channel changed "instantly."

Thanks for the quick feedback! I did some testing and this seemed to mostly
work (thanks!), although I got this error once:
http://cvs.mythtv.org/trac/ticket/5278. I'm nervous that returning from the
channel change script before the firewire connection has stabilized means
that myth may not get a lock on the connection and consequently may give up
on the recording before the connection has stabilized. Is that possible?
I'll watch the logs over the next week or so to see if regular (non-testing)
tv viewing is affected.

> >  Attached is a simple patch to move this timeout from the code to the
> >  database.  It still defaults to 30 seconds so users won't notice a
> >  difference but makes it easier to increase (or decrease) the timeout
> if
> >  necessary.
> >
> >  I wasn't sure how to add the default value to the db so I added it
> to the
> >  end of dbcheck.cpp.
> >
> There's no reason to put the setting in the DB as the line:
> uint timeout = gContext->GetNumSetting("ChannelChangeTimeout", 30);
> specifies a default value of 30, which will be used if there's no value
> in the DB.

The reason I suggested adding it to the db was so that a user could stumble
upon it in the db settings table without having to dig through the code to
find it.  I've found a few settings this way, but I wasn't sure if this was
a common practice. Do new settings not typically get default values in the

Thanks again!

More information about the mythtv-dev mailing list