From 5d8e3b18dc610e2696606092ba66e1477eccce88 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sun, 14 May 2006 18:00:00 +0200 Subject: =?UTF-8?q?Version=201.4.0-1=20-=20Updated=20'S110W'=20in=20'sourc?= =?UTF-8?q?es.conf'.=20-=20Adjusted=20the=20'runvdr'=20script=20so=20that?= =?UTF-8?q?=20the=20user=20can=20fill=20in=20the=20functions=20to=20=20=20?= =?UTF-8?q?detect,=20load=20and=20unload=20the=20necessary=20driver=20modu?= =?UTF-8?q?les=20(thanks=20to=20M.=20Kiesel=20for=20=20=20reporting=20that?= =?UTF-8?q?=20it=20still=20used=20DVBDIR).=20-=20Added=20'eval'=20to=20the?= =?UTF-8?q?=20$VDRCMD=20call=20in=20'runvdr'=20to=20avoid=20problems=20wit?= =?UTF-8?q?h=20quoting=20=20=20(suggested=20by=20Udo=20Richter).=20-=20Fix?= =?UTF-8?q?ed=20missing=20','=20in=20the=20Italian=20and=20Polish=20OSD=20?= =?UTF-8?q?texts=20(thanks=20to=20Marko=20M=C3=A4kel=C3=A4).=20-=20Updated?= =?UTF-8?q?=20the=20Czech=20OSD=20texts=20(thanks=20to=20Vladim=C3=ADr=20B?= =?UTF-8?q?=C3=A1rta).=20-=20Fixed=20handling=20the=20"Power"=20key=20in?= =?UTF-8?q?=20case=20a=20timer=20is=20about=20to=20start=20recording=20=20?= =?UTF-8?q?=20(thanks=20to=20Udo=20Richter).=20-=20Fixed=20the=20character?= =?UTF-8?q?=20'r'=20in=20fontosd=20and=20fontsml=20for=20iso8859-2=20(than?= =?UTF-8?q?ks=20to=20Vladim=C3=ADr=20=20=20B=C3=A1rta).=20-=20When=20check?= =?UTF-8?q?ing=20whether=20a=20VPS=20timer=20has=20entered=20the=20"VPS=20?= =?UTF-8?q?margin",=20the=20event's=20start=20=20=20time=20is=20now=20used?= =?UTF-8?q?=20instead=20of=20the=20timer's=20start=20time,=20because=20oth?= =?UTF-8?q?erwise=20events=20that=20=20=20start=20way=20off=20of=20their?= =?UTF-8?q?=20VPS=20time=20wouldn't=20be=20recorded=20correctly.=20-=20If?= =?UTF-8?q?=20VPS=20timers=20are=20active,=20their=20events=20are=20now=20?= =?UTF-8?q?being=20kept=20up=20to=20date=20if=20there=20=20=20are=20any=20?= =?UTF-8?q?free=20devices=20available.=20-=20Fixed=20the=20character=20#20?= =?UTF-8?q?7=20in=20fontosd=20for=20iso8859-2=20(thanks=20to=20Vladim?= =?UTF-8?q?=C3=ADr=20B=C3=A1rta).=20-=20Fixed=20handling=20unknown=20codes?= =?UTF-8?q?=20when=20learning=20LIRC=20remote=20control=20codes=20(reporte?= =?UTF-8?q?d=20=20=20by=20Helmut=20Auer).=20-=20Since=20some=20channels=20?= =?UTF-8?q?(especially=20the=20Austrian=20ORF)=20randomly=20change=20the?= =?UTF-8?q?=20ids=20of=20their=20=20=20EPG=20events,=20VDR=20now=20gives?= =?UTF-8?q?=20the=20start=20time=20precedence=20when=20searching=20for=20e?= =?UTF-8?q?xisting=20=20=20events.=20-=20Fixed=20automatically=20updating?= =?UTF-8?q?=20the=20CAM=20menu=20in=20case=20the=20whole=20operation=20(fo?= =?UTF-8?q?r=20=20=20instance=20a=20firmware=20update)=20takes=20longer=20?= =?UTF-8?q?than=20the=20menu=20timeout.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CONTRIBUTORS | 13 +++++- HISTORY | 30 +++++++++++++- INSTALL | 3 ++ config.h | 4 +- epg.c | 18 +++++---- fontosd-iso8859-2.c | 112 ++++++++++++++++++++++++++-------------------------- fontsml-iso8859-2.c | 48 +++++++++++----------- i18n.c | 22 +++++------ remote.c | 12 +++--- runvdr | 39 +++++++++++++----- sources.conf | 2 +- timers.c | 13 +++--- vdr.c | 58 ++++++++++++++++++--------- 13 files changed, 232 insertions(+), 142 deletions(-) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 54e36df..4624d60 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -563,6 +563,8 @@ Helmut Auer there are too many levels of symbolic links for reporting that an attempt to call a plugin's main menu function while a message is being displayed didn't work + for reporting a problem with the "Press any key on the RC unit" step when learning + LIRC remote control codes Jeremy Hall for fixing an incomplete initialization of the filter parameters in eit.c @@ -1422,6 +1424,9 @@ Udo Richter for providing a shorter version of the 'sed' expression for extracting APIVERSION for fixing a bug in handling the "Power" key in case a recording is going on and no plugin is active + for suggesting to add 'eval' to the $VDRCMD call in 'runvdr' to avoid problems with + quoting + for fixing handling the "Power" key in case a timer is about to start recording Sven Kreiensen for his help in keeping 'channels.conf.terr' up to date @@ -1677,6 +1682,7 @@ Marko M for reporting that a menu was automatically closed when a replay ends for suggesting to ignore k_Repeat when deciding whether the same key has been pressed in string input fields + for fixing missing ',' in the Italian and Polish OSD texts Patrick Rother for reporting a bug in defining timers that only differ in the day of week @@ -1828,8 +1834,10 @@ Ronny Kornexl font if set to '3' - even if it would have been a fixed font for reporting a bug in initializing 'noapiv' in the Makefile -Bárta Vladimír +Vladimír Bárta for translating OSD texts to the Czech language + for fixing the character 'r' in fontosd and fontsml for iso8859-2 + for fixing the character #207 in fontosd for iso8859-2 Christoph Haubrich for making the "Ok" key in the "Jump" mode of the replay progress display confirm @@ -1894,3 +1902,6 @@ Werner F Dominique Simon for reporting a bug in handling the "Power" key in case a recording is going on and no plugin is active + +M. Kiesel + for reporting that the 'runvdr' script still used DVBDIR diff --git a/HISTORY b/HISTORY index 7bba277..3934eb8 100644 --- a/HISTORY +++ b/HISTORY @@ -4283,7 +4283,7 @@ Video Disk Recorder Revision History - Speeded up cVideoRepacker (thanks to Reinhard Nissl). - Added an 'Id' parameter to cDevice::PlayAudio() to allow plugins to easier process the audio data (thanks to Marco Schlüßler). -- Added Czech language texts (thanks to Bárta Vladimír). +- Added Czech language texts (thanks to Vladimír Bárta). Plugin authors may want to add the new entries to their I18N texts and contact the translators to have their texts translated. Note that there are now 21 different OSD languages, so please make sure you have 21 versions for each of @@ -4687,3 +4687,31 @@ Video Disk Recorder Revision History - Fixed a memory leak in closing the video file during replay (thanks to Tobias Grimm). - Updated the Italian OSD texts (thanks to Nino Gerbino and Antonio Ospite). - Updated the Estonian OSD texts (thanks to Arthur Konovalov). + +2006-05-14: Version 1.4.0-1 + +- Updated 'S110W' in 'sources.conf'. +- Adjusted the 'runvdr' script so that the user can fill in the functions to + detect, load and unload the necessary driver modules (thanks to M. Kiesel for + reporting that it still used DVBDIR). +- Added 'eval' to the $VDRCMD call in 'runvdr' to avoid problems with quoting + (suggested by Udo Richter). +- Fixed missing ',' in the Italian and Polish OSD texts (thanks to Marko Mäkelä). +- Updated the Czech OSD texts (thanks to Vladimír Bárta). +- Fixed handling the "Power" key in case a timer is about to start recording + (thanks to Udo Richter). +- Fixed the character 'r' in fontosd and fontsml for iso8859-2 (thanks to Vladimír + Bárta). +- When checking whether a VPS timer has entered the "VPS margin", the event's start + time is now used instead of the timer's start time, because otherwise events that + start way off of their VPS time wouldn't be recorded correctly. +- If VPS timers are active, their events are now being kept up to date if there + are any free devices available. +- Fixed the character #207 in fontosd for iso8859-2 (thanks to Vladimír Bárta). +- Fixed handling unknown codes when learning LIRC remote control codes (reported + by Helmut Auer). +- Since some channels (especially the Austrian ORF) randomly change the ids of their + EPG events, VDR now gives the start time precedence when searching for existing + events. +- Fixed automatically updating the CAM menu in case the whole operation (for + instance a firmware update) takes longer than the menu timeout. diff --git a/INSTALL b/INSTALL index a7cd588..6cbc8b5 100644 --- a/INSTALL +++ b/INSTALL @@ -133,6 +133,9 @@ call to the VDR program, be sure to NOT use the '-d' option! Otherwise VDR will go into 'daemon' mode and the initial program call will return immediately! 'runvdr' needs to be started as user 'root'. Use the '-u' option to run the actual 'vdr' program under a different user id. +Note that the 'runvdr' script needs to be adjusted to your particular +requirements before you can actually use it. See the comments inside +the script for more information. Setting the system time: ------------------------ diff --git a/config.h b/config.h index 0138d31..0f042cf 100644 --- a/config.h +++ b/config.h @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: config.h 1.255 2006/04/29 09:24:07 kls Exp $ + * $Id: config.h 1.256 2006/05/07 09:01:49 kls Exp $ */ #ifndef __CONFIG_H @@ -21,7 +21,7 @@ // VDR's own version number: -#define VDRVERSION "1.4.0" +#define VDRVERSION "1.4.0-1" #define VDRVERSNUM 10400 // Version * 10000 + Major * 100 + Minor // The plugin API's version number: diff --git a/epg.c b/epg.c index bc448cf..96c43e5 100644 --- a/epg.c +++ b/epg.c @@ -7,7 +7,7 @@ * Original version (as used in VDR before 1.3.0) written by * Robert Schneider and Rolf Hakenes . * - * $Id: epg.c 1.72 2006/04/22 12:02:47 kls Exp $ + * $Id: epg.c 1.74 2006/05/12 13:25:44 kls Exp $ */ #include "epg.h" @@ -327,8 +327,10 @@ bool cEvent::Read(FILE *f, cSchedule *Schedule) cEvent *newEvent = NULL; if (Event) DELETENULL(Event->components); - if (!Event) + if (!Event) { Event = newEvent = new cEvent(EventID); + Event->seen = 0; + } if (Event) { Event->SetTableID(TableID); Event->SetStartTime(StartTime); @@ -710,12 +712,12 @@ const cEvent *cSchedule::GetFollowingEvent(void) const const cEvent *cSchedule::GetEvent(tEventID EventID, time_t StartTime) const { - // Returns either the event info with the given EventID or, if that one can't - // be found, the one with the given StartTime (or NULL if neither can be found) - cEvent *pt = eventsHashID.Get(EventID); - if (!pt && StartTime > 0) // 'StartTime < 0' is apparently used with NVOD channels - pt = eventsHashStartTime.Get(StartTime); - return pt; + // Returns the event info with the given StartTime or, if no actual StartTime + // is given, the one with the given EventID. + if (StartTime > 0) // 'StartTime < 0' is apparently used with NVOD channels + return eventsHashStartTime.Get(StartTime); + else + return eventsHashID.Get(EventID); } const cEvent *cSchedule::GetEventAround(time_t Time) const diff --git a/fontosd-iso8859-2.c b/fontosd-iso8859-2.c index c5f6640..66224ad 100644 --- a/fontosd-iso8859-2.c +++ b/fontosd-iso8859-2.c @@ -2471,34 +2471,34 @@ static const cFont::tPixelData FontOsd_iso8859_2[][29] = { 0x0000000C, // .........**.. }, { // 114 - 10, 27, - 0x00000000, // .......... - 0x00000000, // .......... - 0x00000000, // .......... - 0x00000000, // .......... - 0x00000000, // .......... - 0x00000000, // .......... - 0x00000000, // .......... - 0x00000000, // .......... - 0x00000000, // .......... - 0x00000000, // .......... - 0x000000CE, // ..**..***. - 0x000000FE, // ..*******. - 0x000000E0, // ..***..... - 0x000000C0, // ..**...... - 0x000000C0, // ..**...... - 0x000000C0, // ..**...... - 0x000000C0, // ..**...... - 0x000000C0, // ..**...... - 0x000000C0, // ..**...... - 0x000000C0, // ..**...... - 0x000000C0, // ..**...... - 0x000000C0, // ..**...... - 0x00000000, // .......... - 0x00000000, // .......... - 0x00000000, // .......... - 0x00000000, // .......... - 0x00000000, // .......... + 8, 27, + 0x00000000, // ........ + 0x00000000, // ........ + 0x00000000, // ........ + 0x00000000, // ........ + 0x00000000, // ........ + 0x00000000, // ........ + 0x00000000, // ........ + 0x00000000, // ........ + 0x00000000, // ........ + 0x00000000, // ........ + 0x0000000E, // ....***. + 0x0000003E, // ..*****. + 0x00000038, // ..***... + 0x00000030, // ..**.... + 0x00000030, // ..**.... + 0x00000030, // ..**.... + 0x00000030, // ..**.... + 0x00000030, // ..**.... + 0x00000030, // ..**.... + 0x00000030, // ..**.... + 0x00000030, // ..**.... + 0x00000030, // ..**.... + 0x00000000, // ........ + 0x00000000, // ........ + 0x00000000, // ........ + 0x00000000, // ........ + 0x00000000, // ........ }, { // 115 12, 27, @@ -5261,34 +5261,34 @@ static const cFont::tPixelData FontOsd_iso8859_2[][29] = { 0x00000000, // ........ }, { // 207 - 6, 27, - 0x00000000, // ...... - 0x00000033, // **..** - 0x00000033, // **..** - 0x00000033, // **..** - 0x00000000, // ...... - 0x0000000C, // ..**.. - 0x0000000C, // ..**.. - 0x0000000C, // ..**.. - 0x0000000C, // ..**.. - 0x0000000C, // ..**.. - 0x0000000C, // ..**.. - 0x0000000C, // ..**.. - 0x0000000C, // ..**.. - 0x0000000C, // ..**.. - 0x0000000C, // ..**.. - 0x0000000C, // ..**.. - 0x0000000C, // ..**.. - 0x0000000C, // ..**.. - 0x0000000C, // ..**.. - 0x0000000C, // ..**.. - 0x0000000C, // ..**.. - 0x0000000C, // ..**.. - 0x00000000, // ...... - 0x00000000, // ...... - 0x00000000, // ...... - 0x00000000, // ...... - 0x00000000, // ...... + 17, 27, + 0x00001860, // ....**....**..... + 0x00000CC0, // .....**..**...... + 0x00000780, // ......****....... + 0x00000300, // .......**........ + 0x00000000, // ................. + 0x00007FC0, // ..*********...... + 0x00007FF0, // ..***********.... + 0x00006078, // ..**......****... + 0x00006018, // ..**........**... + 0x00006018, // ..**........**... + 0x0000600C, // ..**.........**.. + 0x0000600C, // ..**.........**.. + 0x0000600C, // ..**.........**.. + 0x0000600C, // ..**.........**.. + 0x0000600C, // ..**.........**.. + 0x0000600C, // ..**.........**.. + 0x0000600C, // ..**.........**.. + 0x00006018, // ..**........**... + 0x00006018, // ..**........**... + 0x00006070, // ..**......***.... + 0x00007FF0, // ..***********.... + 0x00007FC0, // ..*********...... + 0x00000000, // ................. + 0x00000000, // ................. + 0x00000000, // ................. + 0x00000000, // ................. + 0x00000000, // ................. }, { // 208 iso8859-2 17, 27, diff --git a/fontsml-iso8859-2.c b/fontsml-iso8859-2.c index af1d8a8..8b02a17 100644 --- a/fontsml-iso8859-2.c +++ b/fontsml-iso8859-2.c @@ -2132,30 +2132,30 @@ static const cFont::tPixelData FontSml_iso8859_2[][25] = { 0x00000006, // ........**. }, { // 114 - 9, 23, - 0x00000000, // ......... - 0x00000000, // ......... - 0x00000000, // ......... - 0x00000000, // ......... - 0x00000000, // ......... - 0x00000000, // ......... - 0x00000000, // ......... - 0x00000000, // ......... - 0x00000000, // ......... - 0x000000CC, // .**..**.. - 0x000000F8, // .*****... - 0x000000E0, // .***..... - 0x000000C0, // .**...... - 0x000000C0, // .**...... - 0x000000C0, // .**...... - 0x000000C0, // .**...... - 0x000000C0, // .**...... - 0x000000C0, // .**...... - 0x000000C0, // .**...... - 0x00000000, // ......... - 0x00000000, // ......... - 0x00000000, // ......... - 0x00000000, // ......... + 6, 23, + 0x00000000, // ...... + 0x00000000, // ...... + 0x00000000, // ...... + 0x00000000, // ...... + 0x00000000, // ...... + 0x00000000, // ...... + 0x00000000, // ...... + 0x00000000, // ...... + 0x00000000, // ...... + 0x0000001B, // .**.** + 0x0000001B, // .**.** + 0x0000001C, // .***.. + 0x00000018, // .**... + 0x00000018, // .**... + 0x00000018, // .**... + 0x00000018, // .**... + 0x00000018, // .**... + 0x00000018, // .**... + 0x00000018, // .**... + 0x00000000, // ...... + 0x00000000, // ...... + 0x00000000, // ...... + 0x00000000, // ...... }, { // 115 9, 23, diff --git a/i18n.c b/i18n.c index 61af8a3..d1882c8 100644 --- a/i18n.c +++ b/i18n.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: i18n.c 1.279 2006/04/30 08:51:10 kls Exp $ + * $Id: i18n.c 1.281 2006/05/05 13:26:09 kls Exp $ * * Translations provided by: * @@ -484,7 +484,7 @@ const tI18nPhrase Phrases[] = { { "This event - all channels", "Diese Sendung - alle Kanäle", "Ta oddaja - vsi kanali", - "Questo evento - tutti i canali" + "Questo evento - tutti i canali", "",//TODO "",//TODO "Cet événement - toutes les chaînes", @@ -1703,7 +1703,7 @@ const tI18nPhrase Phrases[] = { "Aucun cryptage", "",//TODO "vapaa", - "nieszyfrowany" + "nieszyfrowany", "en abierto", "",//TODO "Okodad", @@ -2310,7 +2310,7 @@ const tI18nPhrase Phrases[] = { "",//TODO "VPS salvestamine tulekul!", "VPS optagelse starter snart!", - "",//TODO + "Brzo začne nahrávání VPS!", }, { "No free DVB device to record!", "Keine freie DVB-Karte zum Aufnehmen!", @@ -3764,7 +3764,7 @@ const tI18nPhrase Phrases[] = { "",// TODO "ainult PID-id", "kun PIDs", - "",// TODO + "jen PIDs", }, { "names and PIDs", "Namen und PIDs", @@ -4490,7 +4490,7 @@ const tI18nPhrase Phrases[] = { "",// TODO "Kanal käivitamisel", "Kanal ved opstart", - "",// TODO + "Kanál po spuštění", }, { "Setup.Miscellaneous$Initial volume", "Lautstärke beim Einschalten", @@ -4512,7 +4512,7 @@ const tI18nPhrase Phrases[] = { "",// TODO "Helitugevus käivitamisel", "Lydstyrke ved opstart", - "",// TODO + "Hlasitost po spuštění", }, { "Setup.Miscellaneous$as before", "wie vorher", @@ -4534,7 +4534,7 @@ const tI18nPhrase Phrases[] = { "",// TODO "nagu enne", "som fřr", - "",// TODO + "jako naposledy", }, // The days of the week: { "MTWTFSS", @@ -5353,7 +5353,7 @@ const tI18nPhrase Phrases[] = { "",// TODO "Järgmine", "Fremad", - "",// TODO + "Dále", }, { "Key$Prev", "Zurück", @@ -5375,7 +5375,7 @@ const tI18nPhrase Phrases[] = { "",// TODO "Eelmine", "Tilbage", - "",// TODO + "Zpět", }, { "Key$Power", "Ausschalten", @@ -5463,7 +5463,7 @@ const tI18nPhrase Phrases[] = { "",// TODO "Eelmine kanal", "Foregĺende kanal", - "",// TODO + "Předcházející kanál", }, { "Key$Volume+", "Lautstärke+", diff --git a/remote.c b/remote.c index c0b9286..a427740 100644 --- a/remote.c +++ b/remote.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: remote.c 1.50 2006/04/17 08:58:28 kls Exp $ + * $Id: remote.c 1.51 2006/05/12 12:40:15 kls Exp $ */ #include "remote.h" @@ -182,11 +182,11 @@ eKeys cRemote::Get(int WaitMs, char **UnknownCode) repeatTimeout.Set(REPEATTIMEOUT); return k; } - else if (!WaitMs || !keyPressed.TimedWait(mutex, WaitMs) && repeatTimeout.TimedOut()) { - if (learning && UnknownCode) { - *UnknownCode = unknownCode; - unknownCode = NULL; - } + else if (!WaitMs || !keyPressed.TimedWait(mutex, WaitMs) && repeatTimeout.TimedOut()) + return kNone; + else if (learning && UnknownCode && unknownCode) { + *UnknownCode = unknownCode; + unknownCode = NULL; return kNone; } } diff --git a/runvdr b/runvdr index 355549c..701c94c 100755 --- a/runvdr +++ b/runvdr @@ -5,6 +5,11 @@ # If VDR exits abnormally, the driver will be reloaded # and VDR restarted. # +# In order to actually use this script you need to implement +# the functions DriverLoaded(), LoadDriver() and UnloadDriver() +# and maybe adjust the VDRPRG and VDRCMD to your particular +# requirements. +# # Since this script loads the DVB driver, it must be started # as user 'root'. Add the option "-u username" to run VDR # under the given user name. @@ -15,27 +20,43 @@ # See the main source file 'vdr.c' for copyright information and # how to reach the author. # -# $Id: runvdr 1.16 2006/02/04 15:20:48 kls Exp $ +# $Id: runvdr 1.18 2006/05/01 14:51:00 kls Exp $ -DVBDIR="../DVB/driver" VDRPRG="./vdr" VDRCMD="$VDRPRG -w 60 $*" LSMOD="`/sbin/lsmod | grep -w '^dvb' | wc -l`" KILL="/usr/bin/killall -q -TERM" +# Detect whether the DVB driver is already loaded +# and return 0 if it *is* loaded, 1 if not: +function DriverLoaded() +{ + return 1 +} + +# Load all DVB driver modules needed for your hardware: +function LoadDriver() +{ +} + +# Unload all DVB driver modules loaded in LoadDriver(): +function UnloadDriver() +{ +} + # Load driver if it hasn't been loaded already: -if [ $LSMOD -eq 0 ] ; then - (cd $DVBDIR; make insmod) +if ! DriverLoaded; then + LoadDriver fi while (true) do - $VDRCMD + eval "$VDRCMD" if test $? -eq 0 -o $? -eq 2; then exit; fi - date - echo "restarting VDR" + echo "`date` reloading DVB driver" $KILL $VDRPRG sleep 10 - (cd $DVBDIR; make rmmod; make insmod) - date + UnloadDriver + LoadDriver + echo "`date` restarting VDR" done diff --git a/sources.conf b/sources.conf index f3da9ab..fb6cd30 100644 --- a/sources.conf +++ b/sources.conf @@ -164,7 +164,7 @@ S101W DirecTV 1R/4S/8 & AMC4 S103W AMC1 S105W AMC15 S107.3W Anik F1/F1R -S110W DirecTV 5 & Echostar 6/8 +S110W DirecTV 5 & Echostar 6/8/10 S111.1W Anik F2 S113W Solidaridad 2 S119W Echostar 7 & DirecTV 7S diff --git a/timers.c b/timers.c index 3a5b0ba..9b70b57 100644 --- a/timers.c +++ b/timers.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: timers.c 1.58 2006/04/21 15:12:49 kls Exp $ + * $Id: timers.c 1.59 2006/05/13 09:03:59 kls Exp $ */ #include "timers.h" @@ -365,10 +365,13 @@ bool cTimer::Matches(time_t t, bool Directly, int Margin) const } if (HasFlags(tfActive)) { - if (HasFlags(tfVps) && !Directly && event && event->Vps() && event->Schedule() && event->Schedule()->PresentSeenWithin(30)) { - startTime = event->StartTime(); - stopTime = event->EndTime(); - return event->IsRunning(true); + if (HasFlags(tfVps) && event && event->Vps()) { + if (Margin || !Directly) { + startTime = event->StartTime(); + stopTime = event->EndTime(); + if (!Margin) + return event->IsRunning(true); + } } return startTime <= t + Margin && t < stopTime; // must stop *before* stopTime to allow adjacent timers } diff --git a/vdr.c b/vdr.c index 449eadf..6343933 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.267 2006/04/29 09:14:06 kls Exp $ + * $Id: vdr.c 1.272 2006/05/14 09:23:46 kls Exp $ */ #include @@ -74,6 +74,8 @@ #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 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 #define EXIT(v) { ExitCode = (v); goto Exit; } @@ -762,8 +764,25 @@ int main(int argc, char *argv[]) TimerInVpsMargin = false; static time_t DeviceUsed[MAXDEVICES] = { 0 }; for (cTimer *Timer = Timers.First(); Timer; Timer = Timers.Next(Timer)) { - if (Timer->HasFlags(tfActive | tfVps) && !Timer->Recording() && Timer->Matches(Now, true, Setup.VpsMargin)) { - Timer->SetInVpsMargin(true); + 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); + } + } + TimerInVpsMargin |= InVpsMargin | NeedsTransponder; + } + Timer->SetInVpsMargin(InVpsMargin); + if (NeedsTransponder || InVpsMargin) { // Find a device that provides the required transponder: cDevice *Device = NULL; for (int i = 0; i < cDevice::NumDevices(); i++) { @@ -779,13 +798,13 @@ int main(int argc, char *argv[]) if (d->MaySwitchTransponder()) // this one can be switched without disturbing anything else Device = d; - else if (!Device && !d->Receiving() && d->ProvidesTransponderExclusively(Timer->Channel())) + else if (!Device && InVpsMargin && !d->Receiving() && d->ProvidesTransponderExclusively(Timer->Channel())) // use this one only if no other with less impact can be found Device = d; } } } - if (!Device) { + if (!Device && InVpsMargin) { cDevice *d = cDevice::ActualDevice(); if (!d->Receiving() && d->ProvidesTransponder(Timer->Channel()) && Now - DeviceUsed[d->DeviceNumber()] > VPSDEVICETIMEOUT) Device = d; // use the actual device as a last resort @@ -805,10 +824,7 @@ int main(int argc, char *argv[]) Skins.Message(mtInfo, tr("Upcoming VPS recording!")); } } - TimerInVpsMargin = true; } - else - Timer->SetInVpsMargin(false); } LastVpsCheck = time(NULL); } @@ -970,7 +986,7 @@ int main(int argc, char *argv[]) } break; // Power off: - case kPower: + case kPower: { isyslog("Power button pressed"); DELETE_MENU; if (!Shutdown) { @@ -985,8 +1001,20 @@ int main(int argc, char *argv[]) } if (cPluginManager::Active(tr("shut down anyway?"))) break; + cTimer *timer = Timers.GetNextActiveTimer(); + time_t Next = timer ? timer->StartTime() : 0; + time_t Delta = timer ? Next - time(NULL) : 0; + if (Next && Delta <= Setup.MinEventTimeout * 60) { + char *buf; + asprintf(&buf, tr("Recording in %ld minutes, shut down anyway?"), Delta / 60); + bool confirm = Interface->Confirm(buf); + free(buf); + if (!confirm) + break; + } ForceShutdown = true; break; + } default: break; } Interact = Menu ? Menu : cControl::Control(); // might have been closed in the mean time @@ -1004,6 +1032,9 @@ int main(int argc, char *argv[]) else if (time(NULL) - LastActivity > MENUTIMEOUT) state = osEnd; } + // TODO make the CAM menu stay open in case of automatic updates and have it return osContinue; then the following two lines can be removed again + else if (state == osEnd && LastActivity > 1) + LastActivity = time(NULL); switch (state) { case osPause: DELETE_MENU; cControl::Shutdown(); // just in case @@ -1121,15 +1152,6 @@ int main(int argc, char *argv[]) else LastActivity = 1; } - if (UserShutdown && Next && Delta <= Setup.MinEventTimeout * 60 && !ForceShutdown) { - char *buf; - asprintf(&buf, tr("Recording in %ld minutes, shut down anyway?"), Delta / 60); - if (Interface->Confirm(buf)) - ForceShutdown = true; - else - UserShutdown = false; - free(buf); - } if (!Next || Delta > Setup.MinEventTimeout * 60 || ForceShutdown) { ForceShutdown = false; if (timer) -- cgit v1.2.3