From 21f3eaf6c98751cc5931ccfd7bc123f7b7ac38f8 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sun, 4 Jun 2006 18:00:00 +0200 Subject: =?UTF-8?q?Version=201.4.0-3=20-=20Fixed=20the=20PremiereContentTr?= =?UTF-8?q?ansmissionDescriptor=20in=20'libsi'=20(thanks=20to=20Stefan=20?= =?UTF-8?q?=20=20Huelswitt).=20-=20Removed=20all=20the=20compatibility=20'?= =?UTF-8?q?#if=20APIVERSNUM...'=20stuff=20and=20instead=20increased=20=20?= =?UTF-8?q?=20the=20API=20version=20number=20-=20plugins=20will=20have=20t?= =?UTF-8?q?o=20be=20recompiled.=20-=20Removed=20the=20call=20to=20pthread?= =?UTF-8?q?=5Fsetschedparam(childTid,=20SCHED=5FRR,=200)=20in=20thread.c,?= =?UTF-8?q?=20=20=20because=20it=20caused=20a=20compiler=20warning=20with?= =?UTF-8?q?=20post-2.4=20glibc=20(reported=20by=20Ville=20Skytt=C3=A4).=20?= =?UTF-8?q?=20=20Since=20the=20third=20parameter=20has=20to=20be=20non-nul?= =?UTF-8?q?l=20to=20have=20any=20effect,=20the=20call=20was=20=20=20presum?= =?UTF-8?q?ably=20a=20NOP,=20anyway.=20-=20Fixed=20the=20'clean-plugins'?= =?UTF-8?q?=20target=20in=20the=20Makefile=20to=20also=20remove=20addition?= =?UTF-8?q?al=20=20=20plugin=20libraries=20(thanks=20to=20Wayne=20Keer).?= =?UTF-8?q?=20-=20Applied=20the=20fixes=20to=20moving=20and=20deleting=20c?= =?UTF-8?q?hannels=20from=20version=201.4.0-2=20to=20the=20=20=20SVDRP=20c?= =?UTF-8?q?ommands=20MOVC=20and=20DELC=20as=20well.=20-=20Fixed=20handling?= =?UTF-8?q?=20the=20display=20of=20the=20'*'=20indicator=20in=20the=20"Wha?= =?UTF-8?q?t's=20on=20now/next=3F"=20=20=20menu,=20so=20that=20events=20th?= =?UTF-8?q?at=20haven't=20been=20"seen"=20in=20the=20data=20stream=20withi?= =?UTF-8?q?n=2030=20=20=20seconds=20won't=20be=20shown=20as=20"running".?= =?UTF-8?q?=20-=20Fixed=20handling=20tabbed=20item=20display=20in=20'skinc?= =?UTF-8?q?urses'.=20-=20Increased=20the=20column=20spacing=20in=20the=20"?= =?UTF-8?q?Recordings"=20menu=20(was=20too=20small=20for=20the=20=20=20'sk?= =?UTF-8?q?incurses'=20plugin).=20-=20When=20the=20'skincurses'=20plugin?= =?UTF-8?q?=20is=20loaded,=20it=20automatically=20sets=20the=20'curses'=20?= =?UTF-8?q?=20=20skin=20as=20the=20current=20one.=20This=20doesn't=20modif?= =?UTF-8?q?y=20the=20Setup.OSDSkin=20parameter,=20so=20=20=20that=20after?= =?UTF-8?q?=20using=20'skincurses'=20(for=20instance=20for=20debugging)=20?= =?UTF-8?q?the=20previously=20=20=20selected=20skin=20will=20be=20used=20a?= =?UTF-8?q?gain.=20-=20Added=20some=20log=20messages=20when=20setting=20th?= =?UTF-8?q?e=20current=20skin.=20-=20Only=20making=20a=20second=20attempt?= =?UTF-8?q?=20to=20set=20the=20current=20skin=20at=20startup=20if=20the=20?= =?UTF-8?q?first=20=20=20attempt=20has=20failed.=20-=20Now=20switching=20t?= =?UTF-8?q?o=20non-VPS=20timers'=20channels=2060=20seconds=20before=20the?= =?UTF-8?q?=20timer=20starts=20=20=20(if=20a=20free=20device=20is=20availa?= =?UTF-8?q?ble),=20to=20allow=20for=20the=20updating=20of=20EPG=20data=20a?= =?UTF-8?q?nd=20CA=20=20=20descriptors=20before=20the=20actual=20recording?= =?UTF-8?q?=20starts.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vdr.c | 61 +++++++++++++++++++++++++++++++++++-------------------------- 1 file changed, 35 insertions(+), 26 deletions(-) (limited to 'vdr.c') 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 @@ -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()) -- cgit v1.2.3