From 8976ebcec5ca1ac03c54209b7cc12e9d14915c6b Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sun, 4 Jan 2004 12:30:00 +0100 Subject: Implemented automatic PID switching and channel detection --- vdr.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'vdr.c') diff --git a/vdr.c b/vdr.c index 4adb1868..fc12f005 100644 --- a/vdr.c +++ b/vdr.c @@ -22,7 +22,7 @@ * * The project's page is at http://www.cadsoft.de/vdr * - * $Id: vdr.c 1.171 2003/12/22 13:29:24 kls Exp $ + * $Id: vdr.c 1.172 2004/01/04 11:12:05 kls Exp $ */ #include @@ -511,6 +511,25 @@ int main(int argc, char *argv[]) dsyslog("max. latency time %d seconds", MaxLatencyTime); } } + // Handle channel modifications: + if (!Channels.BeingEdited() && Channels.Modified()) { + if (Channels.Lock(false, 100)) { + Channels.Save(); //XXX only after user changes??? + Timers.Save(); + for (cChannel *Channel = Channels.First(); Channel; Channel = Channels.Next(Channel)) { + if (Channel && Channel->Modification(CHANNELMOD_RETUNE)) { + cRecordControls::ChannelDataModified(Channel); + if (Channel->Number() == cDevice::CurrentChannel()) { + if (!cDevice::PrimaryDevice()->Replaying()) { + isyslog("retuning due to modification of channel %d", Channel->Number()); + Channels.SwitchTo(Channel->Number()); + } + } + } + } + Channels.Unlock(); + } + } // Channel display: if (!EITScanner.Active() && cDevice::CurrentChannel() != LastChannel) { if (!Menu) -- cgit v1.2.3