From c37734080c45ef7ba60d589df0d88fb9a6064c1b Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sun, 29 Jan 2006 18:00:00 +0100 Subject: =?UTF-8?q?Version=201.3.41=20-=20EPG=20events=20from=20epg.data?= =?UTF-8?q?=20or=20SVDRP's=20PUTE=20command=20now=20have=20their=20Title?= =?UTF-8?q?=20set=20to=20=20=20"No=20Title"=20if=20none=20was=20set.=20-?= =?UTF-8?q?=20Fixed=20checking=20toFile=20in=20cCuttingThread::Action()=20?= =?UTF-8?q?(found=20in=20a=20larger=20patch=20from=20=20=20Artur=20Skawina?= =?UTF-8?q?).=20-=20Fixed=20a=20crash=20when=20pressing=20'0'=20in=20the?= =?UTF-8?q?=20"Schedule"=20menu=20on=20a=20channel=20that=20doesn't=20=20?= =?UTF-8?q?=20have=20any=20EPG=20data=20(reported=20ny=20Alexander=20Hans)?= =?UTF-8?q?.=20-=20Updated=20the=20Danish=20OSD=20texts=20(thanks=20to=20M?= =?UTF-8?q?ogens=20Elneff).=20-=20Fixed=20a=20missing=20','=20in=20the=20G?= =?UTF-8?q?reek=20OSD=20texts=20(thanks=20to=20Arthur=20Konovalov).=20-=20?= =?UTF-8?q?Updated=20the=20Estonian=20OSD=20texts=20(thanks=20to=20Arthur?= =?UTF-8?q?=20Konovalov).=20-=20Fixed=20handling=20the=20tfRecording=20fla?= =?UTF-8?q?g=20when=20reading=20timers=20(bug=20reported=20by=20Andreas=20?= =?UTF-8?q?=20=20Mair).=20-=20Now=20checking=20whether=20the=20channel=20e?= =?UTF-8?q?xists=20before=20setting=20the=20PMT=20filter=20in=20=20=20cPat?= =?UTF-8?q?Filter::Process()=20(thanks=20to=20Thomas=20Bergwinkl).=20-=20N?= =?UTF-8?q?ow=20trying=20to=20reestablish=20the=20connection=20to=20the=20?= =?UTF-8?q?LIRC=20daemon=20in=20case=20it=20breaks=20=20=20(thanks=20to=20?= =?UTF-8?q?Ville=20Skytt=C3=A4).=20-=20Updated=20the=20Finnish=20OSD=20tex?= =?UTF-8?q?ts=20(thanks=20to=20Rolf=20Ahrenberg).=20-=20Fixed=20channel=20?= =?UTF-8?q?switching=20with=20the=20Down=20(Up)=20key=20in=20case=20the=20?= =?UTF-8?q?current=20channel=20is=20=20=20already=20the=20first=20(last)?= =?UTF-8?q?=20in=20the=20list=20(reported=20by=20Frank=20Kr=C3=B6mmelbein)?= =?UTF-8?q?.=20-=20Removed=20the=20"buffer=20reserve"=20in=20Transfer=20Mo?= =?UTF-8?q?de=20-=20it's=20no=20longer=20necessary=20with=20=20=20recent?= =?UTF-8?q?=20driver/firmware=20versions.=20-=20The=20epg.data=20file=20is?= =?UTF-8?q?=20now=20written=20when=20VDR=20exits=20(suggested=20by=20Danie?= =?UTF-8?q?l=20Karsubka).=20-=20Fixed=20cTimers::GetNextActiveTimer()=20so?= =?UTF-8?q?=20that=20it=20won't=20return=20an=20expired=20timer=20=20=20(r?= =?UTF-8?q?eported=20by=20Rolf=20Ahrenberg).=20-=20Changed=20DVBS=5FTUNE?= =?UTF-8?q?=5FTIMEOUT=20and=20DVBC=5FTUNE=5FTIMEOUT=20to=209000ms=20to=20a?= =?UTF-8?q?void=20problems=20with=20=20=20channels=20that=20have=20low=20s?= =?UTF-8?q?ymbol=20rates=20(reported=20by=20Suur=20Karu).=20-=20Fixed=20di?= =?UTF-8?q?splaying=20the=20current=20audio=20track=20in=20the=20channel?= =?UTF-8?q?=20display.=20-=20When=20reading=20epg.data=20(or=20data=20from?= =?UTF-8?q?=20PUTE),=20the=20version=20number=20of=20events=20with=20=20?= =?UTF-8?q?=20table=20IDs=20smaller=20than=200x50=20is=20now=20ignored=20b?= =?UTF-8?q?ecause=20otherwise=20the=20current=20=20=20running=20status=20w?= =?UTF-8?q?ould=20not=20be=20set=20after=20a=20restart=20of=20VDR.=20-=20I?= =?UTF-8?q?mplemented=20a=20timeout=20for=20remote=20controls=20that=20don?= =?UTF-8?q?'t=20deliver=20"repeat"=20keypresses=20=20=20very=20fast=20(bas?= =?UTF-8?q?ed=20on=20a=20suggestion=20by=20Luca=20Olivetti;=20problem=20wi?= =?UTF-8?q?th=20the=20new=20handling=20=20=20of=20k=5FRepeat=20keypresses?= =?UTF-8?q?=20in=20channel=20switching=20reported=20by=20Udo=20Richter).?= =?UTF-8?q?=20-=20When=20looking=20for=20the=20present=20or=20following=20?= =?UTF-8?q?EPG=20event,=20the=20running=20status=20is=20now=20=20=20always?= =?UTF-8?q?=20taken=20into=20account.=20-=20Now=20initializing=20the=20cha?= =?UTF-8?q?nnels'=20schedule=20pointers=20when=20reading=20the=20epg.data?= =?UTF-8?q?=20file,=20=20=20so=20that=20the=20first=20WhatsOn=20menu=20wil?= =?UTF-8?q?l=20come=20up=20faster.=20-=20If=20a=20shutdown=20is=20requeste?= =?UTF-8?q?d,=20but=20the=20shutdown=20script=20doesn't=20actually=20halt?= =?UTF-8?q?=20the=20=20=20system,=20it=20is=20now=20tried=20again=20after?= =?UTF-8?q?=205=20minutes=20(suggested=20by=20Helmut=20Auer).=20-=20Separa?= =?UTF-8?q?ted=20the=20'install'=20target=20into=20several=20individual=20?= =?UTF-8?q?targets;=20renamed=20the=20=20=20'plugins-install'=20target=20t?= =?UTF-8?q?o=20'install-plugins'=20(thanks=20to=20Helmut=20Auer).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lirc.c | 41 +++++++++++++++++++++++++++-------------- 1 file changed, 27 insertions(+), 14 deletions(-) (limited to 'lirc.c') diff --git a/lirc.c b/lirc.c index ac9de01..9bb8328 100644 --- a/lirc.c +++ b/lirc.c @@ -6,35 +6,28 @@ * * LIRC support added by Carsten Koch 2000-06-16. * - * $Id: lirc.c 1.13 2005/09/02 12:51:35 kls Exp $ + * $Id: lirc.c 1.14 2006/01/27 15:59:47 kls Exp $ */ #include "lirc.h" #include #include -#include #define REPEATLIMIT 20 // ms #define REPEATDELAY 350 // ms #define KEYPRESSDELAY 150 // ms +#define RECONNECTDELAY 3000 // ms cLircRemote::cLircRemote(const char *DeviceName) :cRemote("LIRC") ,cThread("LIRC remote control") { - struct sockaddr_un addr; addr.sun_family = AF_UNIX; strcpy(addr.sun_path, DeviceName); - if ((f = socket(AF_UNIX, SOCK_STREAM, 0)) >= 0) { - if (connect(f, (struct sockaddr *)&addr, sizeof(addr)) >= 0) { - Start(); - return; - } - LOG_ERROR_STR(DeviceName); - close(f); + if (Connect()) { + Start(); + return; } - else - LOG_ERROR_STR(DeviceName); f = -1; } @@ -47,6 +40,20 @@ cLircRemote::~cLircRemote() close(fh); } +bool cLircRemote::Connect(void) +{ + if ((f = socket(AF_UNIX, SOCK_STREAM, 0)) >= 0) { + if (connect(f, (struct sockaddr *)&addr, sizeof(addr)) >= 0) + return true; + LOG_ERROR_STR(addr.sun_path); + close(f); + f = -1; + } + else + LOG_ERROR_STR(addr.sun_path); + return false; +} + bool cLircRemote::Ready(void) { return f >= 0; @@ -67,10 +74,16 @@ void cLircRemote::Action(void) int ret = ready ? safe_read(f, buf, sizeof(buf)) : -1; if (ready && ret <= 0 ) { - esyslog("ERROR: lircd connection lost"); + esyslog("ERROR: lircd connection broken, trying to reconnect every %.1f seconds", float(RECONNECTDELAY) / 1000); close(f); f = -1; - break; + while (Running() && f < 0) { + cCondWait::SleepMs(RECONNECTDELAY); + if (Connect()) { + isyslog("reconnected to lircd"); + break; + } + } } if (ready && ret > 21) { -- cgit v1.2.3