diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2013-02-14 11:02:14 +0100 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2013-02-14 11:02:14 +0100 |
commit | 9455b9a2b09d12746e4de1ba7f47d9383ecda0a8 (patch) | |
tree | cea01695e708432c2a16d5861f57518826f5f2b0 /vdr.c | |
parent | d2cfd52013cc4b3286512880430319669351d1b0 (diff) | |
download | vdr-9455b9a2b09d12746e4de1ba7f47d9383ecda0a8.tar.gz vdr-9455b9a2b09d12746e4de1ba7f47d9383ecda0a8.tar.bz2 |
The timeout for trying to switch to a valid programme is now reset immediately once a programme has been found
Diffstat (limited to 'vdr.c')
-rw-r--r-- | vdr.c | 28 |
1 files changed, 16 insertions, 12 deletions
@@ -22,7 +22,7 @@ * * The project's page is at http://www.tvdr.de * - * $Id: vdr.c 2.48 2013/02/08 10:47:02 kls Exp $ + * $Id: vdr.c 2.49 2013/02/14 10:49:06 kls Exp $ */ #include <getopt.h> @@ -834,22 +834,26 @@ int main(int argc, char *argv[]) time_t Now = time(NULL); // Make sure we have a visible programme in case device usage has changed: - if (!EITScanner.Active() && cDevice::PrimaryDevice()->HasDecoder() && !cDevice::PrimaryDevice()->HasProgramme()) { + if (!EITScanner.Active() && cDevice::PrimaryDevice()->HasDecoder()) { static time_t lastTime = 0; - if (!CamMenuActive() && Now - lastTime > MINCHANNELWAIT) { // !CamMenuActive() to avoid interfering with the CAM if a CAM menu is open - cChannel *Channel = Channels.GetByNumber(cDevice::CurrentChannel()); - if (Channel && (Channel->Vpid() || Channel->Apid(0) || Channel->Dpid(0))) { - if (cDevice::GetDeviceForTransponder(Channel, LIVEPRIORITY) && Channels.SwitchTo(Channel->Number())) // try to switch to the original channel... - ; - else if (LastTimerChannel > 0) { - Channel = Channels.GetByNumber(LastTimerChannel); - if (Channel && cDevice::GetDeviceForTransponder(Channel, LIVEPRIORITY) && Channels.SwitchTo(LastTimerChannel)) // ...or the one used by the last timer + if (!cDevice::PrimaryDevice()->HasProgramme()) { + if (!CamMenuActive() && Now - lastTime > MINCHANNELWAIT) { // !CamMenuActive() to avoid interfering with the CAM if a CAM menu is open + cChannel *Channel = Channels.GetByNumber(cDevice::CurrentChannel()); + if (Channel && (Channel->Vpid() || Channel->Apid(0) || Channel->Dpid(0))) { + if (cDevice::GetDeviceForTransponder(Channel, LIVEPRIORITY) && Channels.SwitchTo(Channel->Number())) // try to switch to the original channel... ; + else if (LastTimerChannel > 0) { + Channel = Channels.GetByNumber(LastTimerChannel); + if (Channel && cDevice::GetDeviceForTransponder(Channel, LIVEPRIORITY) && Channels.SwitchTo(LastTimerChannel)) // ...or the one used by the last timer + ; + } } + lastTime = Now; // don't do this too often + LastTimerChannel = -1; } - lastTime = Now; // don't do this too often - LastTimerChannel = -1; } + else + lastTime = 0; // makes sure we immediately try again next time } // Update the OSD size: { |