summaryrefslogtreecommitdiff
path: root/vdr.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <kls (at) cadsoft (dot) de>2006-01-15 18:00:00 +0100
committerKlaus Schmidinger <kls (at) cadsoft (dot) de>2006-01-15 18:00:00 +0100
commit78e3da813cb4345e57934a9a60f6316f1e257307 (patch)
tree2ce53c2872dd7451c0647ad50fe81306ad985bc0 /vdr.c
parentda948a50d2318fd9c818a4b969b74555ce577b1e (diff)
downloadvdr-patch-lnbsharing-78e3da813cb4345e57934a9a60f6316f1e257307.tar.gz
vdr-patch-lnbsharing-78e3da813cb4345e57934a9a60f6316f1e257307.tar.bz2
Version 1.3.39vdr-1.3.39
- The SVDRP command LSTT now accepts the new option 'id' to have the channels of the timers listed with their unique channel ids instead of their numbers (suggested by Matthias Schniedermeyer). - Added a missing #include <linux/unistd.h> to thread.c (thanks to Ville Skyttä). - Fixed the "plugins-clean" and "plugins-install" targets in the Makefile (thanks to Andreas Brachold). - Fixed handling "more than 3 byte" key sequences in cKbdRemote::ReadKeySequence() (thanks to Peter Bieringer). If you are using the PC keyboard as remote control input you may need to make VDR newly learn the keys by removing the remote.conf file. - To avoid problems with access rights when VDR shall run as 'root' it now skips all SetCaps() and SetUser() calls when it is started as 'root' and "-u root" is given. - Added missing i18n entry for the "Timer" button (thanks to Ville Skyttä) - Updated the Finnish OSD texts (thanks to Rolf Ahrenberg). - Making the "Menu" key behave consistently has not been well received by several users, so the new option "Setup/OSD/Menu button closes" can be used to get the old behavior back (which also is the default value of this option). - Dropped the default vdr user. The program now always runs under the user id it was started from, unless the '-u' option is given and it was started from the 'root' user. If you want to have a default vdr user, you can activate and adjust the "VDR_USER = vdr" line in your Make.config file (from the original patch by Ludwig Nussel). - Key macros can now be defined for all non-modeless keys (suggested by Mirko Dölle). - Adjusted the "KEY MACROS" section of vdr.5 to the new plugin calling mechanism introduced in version 1.3.32. - Removed the now obsolete "ca.conf" section from vdr.1 (thanks to Ville Skyttä). - Added missing description of L and R circular polarization to 'diseqc.conf'. - Added a note about "modprobe capability" to INSTALL (suggested by Patrick Cernko). - Fixed canonicalizing the file name in the SVDRP command GRAB to allow full path names (thanks to Stefan Huelswitt). - Added a missing '-' to the example for viewing a grabbed image on a remote host (reported by Philippe Gramoullé). - Made the "What's on now/next?" menus a lot faster by storing a pointer to each channel's schedule in the cChannel data. - Made the log messages regarding lost lock of devices "info" instead of "error" (suggested by Andreas Brachold). - The SVDRP command GRAB allows file names without extension again (suggested by Stefan Huelswitt). - Pressing '0' in the "Schedule" menu now rotates through displaying "This event on this channel", "This event on all channels" and "All events on all channels". This can be used to find reruns of a given show, or the episodes of a series. Note that if there are many channels in your channels.conf, displaying the "All events on all channels" page may take a while. - The status markers in the "Schedule" menu are now only updated if a submenu is closed in which a timer has been modified, which speeds up closing submenus. - Now only writing Dolby Digital tracks into the 'info.vdr' file of a recording if Setup.UseDolbyDigital is true (suggested by André Weidemann). - Added a leading '0' to the day in the DayDateTime() function (thanks to Rolf Ahrenberg). - No longer displaying color buttons in the recording info menu if it has been invoked from a player (reported by Jürgen Schilling).
Diffstat (limited to 'vdr.c')
-rw-r--r--vdr.c54
1 files changed, 30 insertions, 24 deletions
diff --git a/vdr.c b/vdr.c
index a476a25..bd4f950 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.233 2006/01/08 11:49:03 kls Exp $
+ * $Id: vdr.c 1.238 2006/01/15 13:31:57 kls Exp $
*/
#include <getopt.h>
@@ -157,14 +157,13 @@ int main(int argc, char *argv[])
// Command line options:
-#define DEFAULTVDRUSER "vdr"
#define DEFAULTSVDRPPORT 2001
#define DEFAULTWATCHDOG 0 // seconds
#define DEFAULTPLUGINDIR PLUGINDIR
#define DEFAULTEPGDATAFILENAME "epg.data"
bool StartedAsRoot = false;
- const char *VdrUser = DEFAULTVDRUSER;
+ const char *VdrUser = NULL;
int SVDRPport = DEFAULTSVDRPPORT;
const char *AudioCommand = NULL;
const char *ConfigDirectory = NULL;
@@ -192,6 +191,9 @@ int main(int argc, char *argv[])
#if defined(VFAT)
VfatFileSystem = true;
#endif
+#if defined(VDR_USER)
+ VdrUser = VDR_USER;
+#endif
cPluginManager PluginManager(DEFAULTPLUGINDIR);
int ExitCode = 0;
@@ -337,16 +339,18 @@ int main(int argc, char *argv[])
// Set user id in case we were started as root:
- if (getuid() == 0) {
+ if (VdrUser && getuid() == 0) {
StartedAsRoot = true;
- if (!SetKeepCaps(true))
- return 2;
- if (!SetUser(VdrUser))
- return 2;
- if (!SetKeepCaps(false))
- return 2;
- if (!SetCapSysTime())
- return 2;
+ if (strcmp(VdrUser, "root")) {
+ if (!SetKeepCaps(true))
+ return 2;
+ if (!SetUser(VdrUser))
+ return 2;
+ if (!SetKeepCaps(false))
+ return 2;
+ if (!SetCapSysTime())
+ return 2;
+ }
}
// Help and version info:
@@ -392,8 +396,8 @@ int main(int argc, char *argv[])
" -r CMD, --record=CMD call CMD before and after a recording\n"
" -s CMD, --shutdown=CMD call CMD to shutdown the computer\n"
" -t TTY, --terminal=TTY controlling tty\n"
- " -u USER, --user=USER run as user USER (default: %s); only applicable\n"
- " if started as root\n"
+ " -u USER, --user=USER run as user USER; only applicable if started as\n"
+ " root\n"
" -v DIR, --video=DIR use DIR as video directory (default: %s)\n"
" -V, --version print version information and exit\n"
" --vfat encode special characters in recording names to\n"
@@ -406,7 +410,6 @@ int main(int argc, char *argv[])
LIRC_DEVICE,
DEFAULTSVDRPPORT,
RCU_DEVICE,
- DEFAULTVDRUSER,
VideoDirectory,
DEFAULTWATCHDOG
);
@@ -471,7 +474,7 @@ int main(int argc, char *argv[])
}
isyslog("VDR version %s started", VDRVERSION);
- if (StartedAsRoot)
+ if (StartedAsRoot && VdrUser)
isyslog("switched to user '%s'", VdrUser);
if (DaemonMode)
dsyslog("running as daemon (tid=%d)", cThread::ThreadId());
@@ -687,9 +690,10 @@ int main(int argc, char *argv[])
if (!Channels.BeingEdited() && !Timers.BeingEdited()) {
int modified = Channels.Modified();
static time_t ChannelSaveTimeout = 0;
+ static int TimerState = 0;
// Channels and timers need to be stored in a consistent manner,
// therefore if one of them is changed, we save both.
- if (modified == CHANNELSMOD_USER || Timers.Modified())
+ if (modified == CHANNELSMOD_USER || Timers.Modified(TimerState))
ChannelSaveTimeout = 1; // triggers an immediate save
else if (modified && !ChannelSaveTimeout)
ChannelSaveTimeout = time(NULL) + CHANNELSAVEDELTA;
@@ -785,14 +789,17 @@ int main(int argc, char *argv[])
// Keys that must work independent of any interactive mode:
switch (key) {
// Menu control:
- case kMenu:
+ case kMenu: {
key = kNone; // nobody else needs to see this key
+ bool WasOpen = Interact != NULL;
+ bool WasMenu = Interact && Interact->IsMenu();
if (Menu)
DELETE_MENU;
else if (cControl::Control() && cOsd::IsOpen())
cControl::Control()->Hide();
- else
+ if (!WasOpen || !WasMenu && !Setup.MenuButtonCloses)
Menu = new cMenuMain;
+ }
break;
// Info:
case kInfo: {
@@ -978,6 +985,10 @@ int main(int argc, char *argv[])
}
else {
// Key functions in "normal" viewing mode:
+ if (KeyMacros.Get(key)) {
+ cRemote::PutMacro(key);
+ key = kNone;
+ }
switch (key) {
// Toggle channels:
case k0: {
@@ -1013,11 +1024,6 @@ int main(int argc, char *argv[])
cControl::Launch(new cReplayControl);
}
break;
- // Key macros:
- case kRed:
- case kGreen:
- case kYellow:
- case kBlue: cRemote::PutMacro(key); break;
default: break;
}
}