summaryrefslogtreecommitdiff
path: root/lirc.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <kls (at) cadsoft (dot) de>2003-04-13 18:00:00 +0200
committerKlaus Schmidinger <kls (at) cadsoft (dot) de>2003-04-13 18:00:00 +0200
commit9f919801465f49be6b2118f54bd54df846e2f865 (patch)
tree721f42c9fd88ab33b47ad9b945247353bac9bc4c /lirc.c
parentb60eda5a8e8a9b9b96a90016fd27c03cd3f1ec8b (diff)
downloadvdr-patch-lnbsharing-9f919801465f49be6b2118f54bd54df846e2f865.tar.gz
vdr-patch-lnbsharing-9f919801465f49be6b2118f54bd54df846e2f865.tar.bz2
Version 1.1.27vdr-1.1.27
- The CAM is now accessed only if the current channel actually has a non-zero Ca value, and CAM access is completely suppressed during replay, which avoids problems in case the CAM is attached to the primary DVB device. - The "Left" and "Right" buttons now set the cursor to the first or last list item even if the list consist only of a single page, like, for instance, the Main menu (thanks to Oliver Endriss). - Made the log message "OSD window width must be a multiple of 4..." a debug message instead of an error message, so it can be avoided by using a log level less than 3. - Updated Greek language texts (thanks to Dimitrios Dimitrakos). - Fixed faulty behaviour of the "Mute" key in case the channel display is visible (thanks to Florian Bartels for reporting this one and Sascha Volkenandt for helping to fix it). - Modified LOF handling to allow for C-band reception (thanks to Malcolm Caldwell). - Added some missing cAudio handling calls (thanks to Werner Fink). - Replaced the 'for' loops in StripAudioPackets() with memset() calls (thanks to Werner Fink). - Further increased the timeout until an index file is considerd no longer to be written. - Fixed a crash in case the index file can't be accessed any more during replay (thanks to Stefan Huelswitt for reporting this one). - Fixed displaying messages in the status line in case they exceed the OSD width (thanks to Gerhard Steiner for reporting this one). - Avoiding high CPU load in case the connection to LIRC gets lost (thanks to Ludwig Nussel). - Fixed handling repeat function with LIRC (thanks to Ludwig Nussel). - Fixed handling min/max borders when entering integer values (thanks to Andy Grobb for reporting this one). - Implemented a "resume ID" which allows several users to each have their own resume.vdr files (thanks to Martin Hammerschmid). This parameter can be set in the "Setup/Replay" menu (see MANUAL for details). - Now using 'libdtv' version 0.0.5 (thanks to Rolf Hakenes for the new version and Stefan Huelswitt for adapting VDR to it). - If no device with an MPEG decoder can be found at startup, the first device is now used as primary device (just to have some device). - Adjusted some Premiere channels in 'channels.conf' (thanks to Thomas Koch). - Updated 'channels.conf.cable' (thanks to Stefan Hußfeldt). - The 'epg.data' file is now read after all plugins have been started (thanks to Sascha Volkenandt). - The LIRC remote control no longer tries to learn keys if it can't connect to the LIRC daemon (thanks to Ludwig Nussel for reporting this one). The same applies to the RCU remote control in case of errors during startup. - Fixed handling of Ca parameters with values <= MAXDEVICES, which don't indicate an actual encrypted channel (thanks to Stefan Huelswitt for reporting this one).
Diffstat (limited to 'lirc.c')
-rw-r--r--lirc.c26
1 files changed, 23 insertions, 3 deletions
diff --git a/lirc.c b/lirc.c
index f120743..b7f5b93 100644
--- a/lirc.c
+++ b/lirc.c
@@ -6,7 +6,7 @@
*
* LIRC support added by Carsten Koch <Carsten.Koch@icem.de> 2000-06-16.
*
- * $Id: lirc.c 1.1 2002/09/29 13:16:33 kls Exp $
+ * $Id: lirc.c 1.4 2003/04/12 14:37:17 kls Exp $
*/
#include "lirc.h"
@@ -41,6 +41,11 @@ cLircRemote::~cLircRemote()
Cancel();
}
+bool cLircRemote::Ready(void)
+{
+ return f >= 0;
+}
+
void cLircRemote::Action(void)
{
dsyslog("LIRC remote control thread started (pid=%d)", getpid());
@@ -50,34 +55,49 @@ void cLircRemote::Action(void)
char buf[LIRC_BUFFER_SIZE];
char LastKeyName[LIRC_KEY_BUF] = "";
bool repeat = false;
+ int timeout = -1;
for (; f >= 0;) {
LOCK_THREAD;
- if (cFile::FileReady(f, REPEATLIMIT) && safe_read(f, buf, sizeof(buf)) > 21) {
+ bool ready = cFile::FileReady(f, timeout);
+ int ret = ready ? safe_read(f, buf, sizeof(buf)) : -1;
+
+ if (ready) {
+ if (ret <= 21) {
+ esyslog("ERROR: lircd connection lost");
+ close(f);
+ f = -1;
+ break;
+ }
int count;
char KeyName[LIRC_KEY_BUF];
sscanf(buf, "%*x %x %29s", &count, KeyName); // '29' in '%29s' is LIRC_KEY_BUF-1!
int Now = time_ms();
if (count == 0) {
+ if (repeat)
+ Put(LastKeyName, false, true);
strcpy(LastKeyName, KeyName);
repeat = false;
FirstTime = Now;
+ timeout = -1;
}
else {
if (Now - FirstTime < REPEATDELAY)
continue; // repeat function kicks in after a short delay
repeat = true;
+ timeout = REPEATDELAY;
}
LastTime = Now;
Put(KeyName, repeat);
}
else if (repeat) { // the last one was a repeat, so let's generate a release
- if (time_ms() - LastTime > REPEATDELAY) {
+ if (time_ms() - LastTime >= REPEATDELAY) {
Put(LastKeyName, false, true);
repeat = false;
*LastKeyName = 0;
+ timeout = -1;
}
}
}