diff options
author | Klaus Schmidinger <kls (at) cadsoft (dot) de> | 2006-06-18 18:00:00 +0200 |
---|---|---|
committer | Klaus Schmidinger <kls (at) cadsoft (dot) de> | 2006-06-18 18:00:00 +0200 |
commit | 90bc2f18e3fb72bba792226dfd2a6e245464d2f5 (patch) | |
tree | 91c7685580e639523ffd3f79c4993b6b48451e91 /vdr.c | |
parent | 2bb325135433521694b0a387a60225d7727a980e (diff) | |
download | vdr-patch-lnbsharing-90bc2f18e3fb72bba792226dfd2a6e245464d2f5.tar.gz vdr-patch-lnbsharing-90bc2f18e3fb72bba792226dfd2a6e245464d2f5.tar.bz2 |
Version 1.4.1-1vdr-1.4.1-1
- Added "-fPIC" to the compiler options in Make.config.template when compiling
plugins (thanks to Udo Richter). If you use your own Make.config file, you may
want to add these lines there, too.
- Added some comment to cDevice::GetDevice() to explain how the individual
conditions are put together to make a decision on which device to use.
- Updated 'S13E' in 'sources.conf' (thanks to Antti Hartikainen).
- Now making sure VPS timers don't get stuck with outdated events, and that the
actual device isn't used for updating a VPS timer's event as long as other
free devices are available.
- Modified rcu.c to better handle RC5 codes.
- Added a missing variable initialization in cRingBufferLinear::cRingBufferLinear()
(thanks to Prakash Punnoor).
- Fixed handling relative link targets in the ReadLink() function (reported by
Patrick Cernko).
- Now making sure a VPS timer has a schedule in case the epg.data file didn't
contain one when VDR was started.
Diffstat (limited to 'vdr.c')
-rw-r--r-- | vdr.c | 31 |
1 files changed, 18 insertions, 13 deletions
@@ -22,7 +22,7 @@ * * The project's page is at http://www.cadsoft.de/vdr * - * $Id: vdr.c 1.274 2006/06/04 09:04:47 kls Exp $ + * $Id: vdr.c 1.276 2006/06/18 08:49:20 kls Exp $ */ #include <getopt.h> @@ -47,6 +47,7 @@ #include "i18n.h" #include "interface.h" #include "keys.h" +#include "libsi/si.h" #include "lirc.h" #include "menu.h" #include "osdbase.h" @@ -773,15 +774,20 @@ int main(int argc, char *argv[]) bool NeedsTransponder = false; if (Timer->HasFlags(tfActive) && !Timer->Recording()) { if (Timer->HasFlags(tfVps)) { - if (Timer->Matches(Now, true, Setup.VpsMargin)) + if (Timer->Matches(Now, true, Setup.VpsMargin)) { InVpsMargin = true; - else if (Timer->Event()) + Timer->SetInVpsMargin(InVpsMargin); + } + else if (Timer->Event()) { + InVpsMargin = Timer->Event()->StartTime() <= Now && Timer->Event()->RunningStatus() == SI::RunningStatusUndefined; NeedsTransponder = Timer->Event()->StartTime() - Now < VPSLOOKAHEADTIME * 3600 && !Timer->Event()->SeenWithin(VPSUPTODATETIME); + } else { cSchedulesLock SchedulesLock; const cSchedules *Schedules = cSchedules::Schedules(SchedulesLock); if (Schedules) { const cSchedule *Schedule = Schedules->GetSchedule(Timer->Channel()); + InVpsMargin = !Schedule; // we must make sure we have the schedule NeedsTransponder = Schedule && !Schedule->PresentSeenWithin(VPSUPTODATETIME); } } @@ -790,10 +796,10 @@ int main(int argc, char *argv[]) else NeedsTransponder = Timer->Matches(Now, true, TIMERLOOKAHEADTIME); } - Timer->SetInVpsMargin(InVpsMargin); if (NeedsTransponder || InVpsMargin) { // Find a device that provides the required transponder: cDevice *Device = NULL; + bool DeviceAvailable = false; for (int i = 0; i < cDevice::NumDevices(); i++) { cDevice *d = cDevice::GetDevice(i); if (d && d->ProvidesTransponder(Timer->Channel())) { @@ -802,18 +808,17 @@ int main(int argc, char *argv[]) Device = d; break; } - else if (Now - DeviceUsed[d->DeviceNumber()] > TIMERDEVICETIMEOUT) { - // only check other devices if they have been left alone for a while - if (d->MaySwitchTransponder()) - // this one can be switched without disturbing anything else - Device = d; - else if (!Device && InVpsMargin && !d->Receiving() && d->ProvidesTransponderExclusively(Timer->Channel())) - // use this one only if no other with less impact can be found - Device = d; + bool timeout = Now - DeviceUsed[d->DeviceNumber()] > TIMERDEVICETIMEOUT; // only check other devices if they have been left alone for a while + if (d->MaySwitchTransponder()) { + DeviceAvailable = true; // avoids using the actual device below + if (timeout) + Device = d; // only check other devices if they have been left alone for a while } + else if (timeout && !Device && InVpsMargin && !d->Receiving() && d->ProvidesTransponderExclusively(Timer->Channel())) + Device = d; // use this one only if no other with less impact can be found } } - if (!Device && InVpsMargin) { + if (!Device && InVpsMargin && !DeviceAvailable) { cDevice *d = cDevice::ActualDevice(); if (!d->Receiving() && d->ProvidesTransponder(Timer->Channel()) && Now - DeviceUsed[d->DeviceNumber()] > TIMERDEVICETIMEOUT) Device = d; // use the actual device as a last resort |