summaryrefslogtreecommitdiff
path: root/vdr.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <kls (at) cadsoft (dot) de>2007-08-19 18:00:00 +0200
committerKlaus Schmidinger <kls (at) cadsoft (dot) de>2007-08-19 18:00:00 +0200
commite5a2aa41c9762bda4ce7b987aba1bcfa1cee6f70 (patch)
treecb794be1f7796ccbfdd1ce04bca0d75d997ead0b /vdr.c
parent4c65b525dc1e3c62336b223d200a46fb30dc7e52 (diff)
downloadvdr-patch-lnbsharing-e5a2aa41c9762bda4ce7b987aba1bcfa1cee6f70.tar.gz
vdr-patch-lnbsharing-e5a2aa41c9762bda4ce7b987aba1bcfa1cee6f70.tar.bz2
Version 1.5.8vdr-1.5.8
- Added missing install-i18n to the install target in the Makefile (reported by Joachim Wilke). - Fixed a faulty comment in Make.config.template (reported by Marco Schlüßler). - Improved i18n-to-gettext.pl (thanks to Matthias Schwarzott). - Moved the "all" target in plugin Makefiles before the "Implicit rules", so that a plain "make" will compile everything (suggested by Matthias Schwarzott). The "newplugin" script has been changed accordingly. Plugin authors may want to change their Makefiles, too. - Added DESTDIR and PREFIX handling to the Makefile (thanks to Matthias Schwarzott). - Updated the Finnish OSD texts (thanks to Rolf Ahrenberg). - Added internationalization to the "skincurses" plugin (thanks to Rolf Ahrenberg). - Checking the string for NULL in I18nTranslate(). - Updated the French OSD texts (thanks to Bruno Roussel). - Some optimizations in cDvbDevice::SetChannelDevice() (thanks to Tobias Bratfisch). - Optimized cMenuEditChrItem::Set() (thanks to Tobias Bratfisch). - Optimized cNitFilter::Process() (thanks to Tobias Bratfisch). - Reduced the number of time(NULL) calls in vdr.c's main loop to a single call (thanks to Tobias Bratfisch). - Changed cBitmap::DrawText() to always draw the background unless ColorBg is clrTransparent (thanks to Christoph Haubrich). - The "Setup/OSD/Language" menu now only shows those languages that actually have a locale (suggested by Anssi Hannula). - Now using setenv() instead of setlocale() to set the language for gettext() (suggested by Anssi Hannula; thanks also to Ludwig Nussel for a hint on using _nl_msg_cat_cntr). - When scanning the locale directory, VDR now explicitly looks for a file named vdr.mo. Text files for plugins are now named "vdr-name.mo", when "name" is the name of the plugin. The "newplugin" script has been changed accordingly, and plugin authors should change their Makefiles, too.
Diffstat (limited to 'vdr.c')
-rw-r--r--vdr.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/vdr.c b/vdr.c
index b15938a..0f9cf5f 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.296 2007/08/12 11:22:04 kls Exp $
+ * $Id: vdr.c 1.298 2007/08/18 13:03:46 kls Exp $
*/
#include <getopt.h>
@@ -704,10 +704,13 @@ int main(int argc, char *argv[])
#endif
// Attach launched player control:
cControl::Attach();
+
+ 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()) {
static time_t lastTime = 0;
- if (time(NULL) - lastTime > MINCHANNELWAIT) {
+ if (Now - lastTime > MINCHANNELWAIT) {
cChannel *Channel = Channels.GetByNumber(cDevice::CurrentChannel());
if (Channel && (Channel->Vpid() || Channel->Apid(0))) {
if (!Channels.SwitchTo(cDevice::CurrentChannel()) // try to switch to the original channel...
@@ -716,7 +719,7 @@ int main(int argc, char *argv[])
&& !cDevice::SwitchChannel(-1)) // ...or the next lower available one
;
}
- lastTime = time(NULL); // don't do this too often
+ lastTime = Now; // don't do this too often
LastTimerChannel = -1;
}
}
@@ -738,8 +741,8 @@ int main(int argc, char *argv[])
if (modified == CHANNELSMOD_USER || Timers.Modified(TimerState))
ChannelSaveTimeout = 1; // triggers an immediate save
else if (modified && !ChannelSaveTimeout)
- ChannelSaveTimeout = time(NULL) + CHANNELSAVEDELTA;
- bool timeout = ChannelSaveTimeout == 1 || ChannelSaveTimeout && time(NULL) > ChannelSaveTimeout && !cRecordControls::Active();
+ ChannelSaveTimeout = Now + CHANNELSAVEDELTA;
+ bool timeout = ChannelSaveTimeout == 1 || ChannelSaveTimeout && Now > ChannelSaveTimeout && !cRecordControls::Active();
if ((modified || timeout) && Channels.Lock(false, 100)) {
if (timeout) {
Channels.Save();
@@ -767,16 +770,15 @@ int main(int argc, char *argv[])
if (!Menu)
Menu = new cDisplayChannel(cDevice::CurrentChannel(), LastChannel >= 0);
LastChannel = cDevice::CurrentChannel();
- LastChannelChanged = time(NULL);
+ LastChannelChanged = Now;
}
- if (time(NULL) - LastChannelChanged >= Setup.ZapTimeout && LastChannel != PreviousChannel[PreviousChannelIndex])
+ if (Now - LastChannelChanged >= Setup.ZapTimeout && LastChannel != PreviousChannel[PreviousChannelIndex])
PreviousChannel[PreviousChannelIndex ^= 1] = LastChannel;
// Timers and Recordings:
if (!Timers.BeingEdited()) {
// Assign events to timers:
Timers.SetEvents();
// Must do all following calls with the exact same time!
- time_t Now = time(NULL);
// Process ongoing recordings:
cRecordControls::Process(Now);
// Start new recordings:
@@ -863,7 +865,7 @@ int main(int argc, char *argv[])
}
}
}
- LastTimerCheck = time(NULL);
+ LastTimerCheck = Now;
}
// Delete expired timers:
Timers.DeleteExpired();
@@ -1065,7 +1067,7 @@ int main(int argc, char *argv[])
continue;
}
}
- else if (time(NULL) - cRemote::LastActivity() > MENUTIMEOUT)
+ else if (Now - cRemote::LastActivity() > MENUTIMEOUT)
state = osEnd;
}
switch (state) {
@@ -1181,12 +1183,12 @@ int main(int argc, char *argv[])
ShutdownHandler.countdown.Cancel();
}
- if (!Interact && !cRecordControls::Active() && !cCutter::Active() && !Interface->HasSVDRPConnection() && (time(NULL) - cRemote::LastActivity()) > ACTIVITYTIMEOUT) {
+ if (!Interact && !cRecordControls::Active() && !cCutter::Active() && !Interface->HasSVDRPConnection() && (Now - cRemote::LastActivity()) > ACTIVITYTIMEOUT) {
// Handle housekeeping tasks
// Shutdown:
// Check whether VDR will be ready for shutdown in SHUTDOWNWAIT seconds:
- time_t Soon = time(NULL) + SHUTDOWNWAIT;
+ time_t Soon = Now + SHUTDOWNWAIT;
if (ShutdownHandler.IsUserInactive(Soon) && ShutdownHandler.Retry(Soon) && !ShutdownHandler.countdown) {
if (ShutdownHandler.ConfirmShutdown(false))
// Time to shut down - start final countdown: