[mythtv-users] Channel changing question with HD-PVR
Alan Young
ayoung at teleport.com
Thu Jan 21 06:19:28 UTC 2010
Michael T. Dean wrote:
> On 01/20/2010 11:29 PM, Michael T. Dean wrote:
>> On 01/20/2010 11:22 PM, Fred Hamilton wrote:
>>
>> No. Myth always resets everything as if it was starting from scratch
>> just in case something bad happened during the previous recording.
>>
>
> That said, the right approach if you want to only change channels if you
> need to is to have your channel change scripts take care of that.
Yep, that's what I do. In my HDPVR's channel change script, I have:
#!/bin/bash
lc="`cat /dev/last_dtv`"
if [ "$lc" -ne "$*" ]; then
/usr/local/bin/change-channel-dtv.bin $*
echo $* >/dev/last_dtv
fi
I chose /dev as most recent distributions make /dev a tmpfs/ram file so it's
quick and doesn't slow down the channel change. And it also makes the file
temporary. To initialize it, I have the commands
echo 0 >/dev/last_dtv
chown mythtv.mythtv /dev/last_dtv
in /etc/rc.d/rc.local to set it up at boot. mythtv is the user on my system
that mythbackend runs under.
Alan
More information about the mythtv-users
mailing list