summaryrefslogtreecommitdiff
path: root/vdr.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <kls (at) cadsoft (dot) de>2006-06-04 18:00:00 +0200
committerKlaus Schmidinger <kls (at) cadsoft (dot) de>2006-06-04 18:00:00 +0200
commit21f3eaf6c98751cc5931ccfd7bc123f7b7ac38f8 (patch)
treec04b9188a9dbc13033c630b68d72712eff900bed /vdr.c
parent177b875945e5898ebc07d79527e0ddc5e4e0f93d (diff)
downloadvdr-patch-lnbsharing-21f3eaf6c98751cc5931ccfd7bc123f7b7ac38f8.tar.gz
vdr-patch-lnbsharing-21f3eaf6c98751cc5931ccfd7bc123f7b7ac38f8.tar.bz2
Version 1.4.0-3vdr-1.4.0-3
- Fixed the PremiereContentTransmissionDescriptor in 'libsi' (thanks to Stefan Huelswitt). - Removed all the compatibility '#if APIVERSNUM...' stuff and instead increased the API version number - plugins will have to be recompiled. - Removed the call to pthread_setschedparam(childTid, SCHED_RR, 0) in thread.c, because it caused a compiler warning with post-2.4 glibc (reported by Ville Skyttä). Since the third parameter has to be non-null to have any effect, the call was presumably a NOP, anyway. - Fixed the 'clean-plugins' target in the Makefile to also remove additional plugin libraries (thanks to Wayne Keer). - Applied the fixes to moving and deleting channels from version 1.4.0-2 to the SVDRP commands MOVC and DELC as well. - Fixed handling the display of the '*' indicator in the "What's on now/next?" menu, so that events that haven't been "seen" in the data stream within 30 seconds won't be shown as "running". - Fixed handling tabbed item display in 'skincurses'. - Increased the column spacing in the "Recordings" menu (was too small for the 'skincurses' plugin). - When the 'skincurses' plugin is loaded, it automatically sets the 'curses' skin as the current one. This doesn't modify the Setup.OSDSkin parameter, so that after using 'skincurses' (for instance for debugging) the previously selected skin will be used again. - Added some log messages when setting the current skin. - Only making a second attempt to set the current skin at startup if the first attempt has failed. - Now switching to non-VPS timers' channels 60 seconds before the timer starts (if a free device is available), to allow for the updating of EPG data and CA descriptors before the actual recording starts.
Diffstat (limited to 'vdr.c')
-rw-r--r--vdr.c61
1 files changed, 35 insertions, 26 deletions
diff --git a/vdr.c b/vdr.c
index 6343933..2f6ad64 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.272 2006/05/14 09:23:46 kls Exp $
+ * $Id: vdr.c 1.274 2006/06/04 09:04:47 kls Exp $
*/
#include <getopt.h>
@@ -72,8 +72,9 @@
#define DEVICEREADYTIMEOUT 30 // seconds to wait until all devices are ready
#define MENUTIMEOUT 120 // seconds of user inactivity after which an OSD display is closed
#define SHUTDOWNRETRY 300 // seconds before trying again to shut down
-#define VPSCHECKDELTA 10 // seconds between checks for timers that have entered the VPS margin
-#define VPSDEVICETIMEOUT 8 // seconds before a device used for VPS may be reused
+#define TIMERCHECKDELTA 10 // seconds between checks for timers that need to see their channel
+#define TIMERDEVICETIMEOUT 8 // seconds before a device used for timer check may be reused
+#define TIMERLOOKAHEADTIME 60 // seconds before a non-VPS timer starts and the channel is switched if possible
#define VPSLOOKAHEADTIME 24 // hours within which VPS timers will make sure their events are up to date
#define VPSUPTODATETIME 3600 // seconds before the event or schedule of a VPS timer needs to be refreshed
@@ -502,8 +503,9 @@ int main(int argc, char *argv[])
int MaxLatencyTime = 0;
bool ForceShutdown = false;
bool UserShutdown = false;
- bool TimerInVpsMargin = false;
+ bool InhibitEpgScan = false;
bool IsInfoMenu = false;
+ cSkin *CurrentSkin = NULL;
// Load plugins:
@@ -605,6 +607,7 @@ int main(int argc, char *argv[])
new cSkinSTTNG;
Skins.SetCurrent(Setup.OSDSkin);
cThemes::Load(Skins.Current()->Name(), Setup.OSDTheme, Skins.Current()->Theme());
+ CurrentSkin = Skins.Current();
// Start plugins:
@@ -613,8 +616,10 @@ int main(int argc, char *argv[])
// Set skin and theme in case they're implemented by a plugin:
- Skins.SetCurrent(Setup.OSDSkin);
- cThemes::Load(Skins.Current()->Name(), Setup.OSDTheme, Skins.Current()->Theme());
+ if (!CurrentSkin || CurrentSkin == Skins.Current() && strcmp(Skins.Current()->Name(), Setup.OSDSkin) != 0) {
+ Skins.SetCurrent(Setup.OSDSkin);
+ cThemes::Load(Skins.Current()->Name(), Setup.OSDTheme, Skins.Current()->Theme());
+ }
// Remote Controls:
if (RcuDevice)
@@ -758,28 +763,32 @@ int main(int argc, char *argv[])
else
LastTimerChannel = Timer->Channel()->Number();
}
- // Make sure VPS timers "see" their channel early enough:
- static time_t LastVpsCheck = 0;
- if (Now - LastVpsCheck > VPSCHECKDELTA) { // don't do this too often
- TimerInVpsMargin = false;
+ // Make sure timers "see" their channel early enough:
+ static time_t LastTimerCheck = 0;
+ if (Now - LastTimerCheck > TIMERCHECKDELTA) { // don't do this too often
+ InhibitEpgScan = false;
static time_t DeviceUsed[MAXDEVICES] = { 0 };
for (cTimer *Timer = Timers.First(); Timer; Timer = Timers.Next(Timer)) {
bool InVpsMargin = false;
bool NeedsTransponder = false;
- if (Timer->HasFlags(tfActive | tfVps) && !Timer->Recording()) {
- if (Timer->Matches(Now, true, Setup.VpsMargin))
- InVpsMargin = true;
- else if (Timer->Event())
- 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());
- NeedsTransponder = Schedule && !Schedule->PresentSeenWithin(VPSUPTODATETIME);
+ if (Timer->HasFlags(tfActive) && !Timer->Recording()) {
+ if (Timer->HasFlags(tfVps)) {
+ if (Timer->Matches(Now, true, Setup.VpsMargin))
+ InVpsMargin = true;
+ else if (Timer->Event())
+ 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());
+ NeedsTransponder = Schedule && !Schedule->PresentSeenWithin(VPSUPTODATETIME);
+ }
}
+ InhibitEpgScan |= InVpsMargin | NeedsTransponder;
}
- TimerInVpsMargin |= InVpsMargin | NeedsTransponder;
+ else
+ NeedsTransponder = Timer->Matches(Now, true, TIMERLOOKAHEADTIME);
}
Timer->SetInVpsMargin(InVpsMargin);
if (NeedsTransponder || InVpsMargin) {
@@ -793,7 +802,7 @@ int main(int argc, char *argv[])
Device = d;
break;
}
- else if (Now - DeviceUsed[d->DeviceNumber()] > VPSDEVICETIMEOUT) {
+ 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
@@ -806,7 +815,7 @@ int main(int argc, char *argv[])
}
if (!Device && InVpsMargin) {
cDevice *d = cDevice::ActualDevice();
- if (!d->Receiving() && d->ProvidesTransponder(Timer->Channel()) && Now - DeviceUsed[d->DeviceNumber()] > VPSDEVICETIMEOUT)
+ if (!d->Receiving() && d->ProvidesTransponder(Timer->Channel()) && Now - DeviceUsed[d->DeviceNumber()] > TIMERDEVICETIMEOUT)
Device = d; // use the actual device as a last resort
}
// Switch the device to the transponder:
@@ -826,7 +835,7 @@ int main(int argc, char *argv[])
}
}
}
- LastVpsCheck = time(NULL);
+ LastTimerCheck = time(NULL);
}
// Delete expired timers:
Timers.DeleteExpired();
@@ -1125,7 +1134,7 @@ int main(int argc, char *argv[])
}
}
if (!Menu) {
- if (!TimerInVpsMargin)
+ if (!InhibitEpgScan)
EITScanner.Process();
if (!cCutter::Active() && cCutter::Ended()) {
if (cCutter::Error())