From 3db87e806caf5deef10918e58294774a291eb939 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sun, 17 Feb 2002 16:03:49 +0100 Subject: [PATCH] Taking EPG data from 'start + 5min' for instant recordings --- FORMATS | 10 +++++++--- HISTORY | 4 ++++ config.c | 4 ++-- config.h | 8 +++++++- menu.c | 6 ++++-- 5 files changed, 24 insertions(+), 8 deletions(-) diff --git a/FORMATS b/FORMATS index 3e1ff868..9f1a7d99 100644 --- a/FORMATS +++ b/FORMATS @@ -45,10 +45,14 @@ Video Disk Recorder File Formats The fields in a timer definition have the following meaning (from left to right): - - Timer active (0 = inactive, 1 = active) - Values larger than '1' can be used by external programs to mark active timers + - Timer active (0 = inactive, 1 = active, 3 = instant recording) + Values other than these can be used by external programs to mark active timers and recognize if the user has modified them. When a user modifes an active - timer the 'active' field will be explicitly set to '1'. + timer the 'active' field will be explicitly set to '1' (or '0', respectively, + if the user deactivates the timer). + Note: in order to allow future extensibility, external programs using the + 'active' parameter should only use the upper 16 bit of this 32 bit parameter + and leave the lower 16 bit untouched. - Program number of the channel to record - Day of recording (in case of a repeating timer), either one or more of M------ = Monday diff --git a/HISTORY b/HISTORY index 7c9b0e27..9c4ef52d 100644 --- a/HISTORY +++ b/HISTORY @@ -1014,3 +1014,7 @@ Video Disk Recorder Revision History will receive a "First day" setting that skips the timer for this day. - Fixed closing all unused file descriptors when opening a pipe (thanks to Werner Fink). +- Instant recordings now take the EPG data from the point in time at 5 minutes + from the start time of the recording. In order for this to work the 'active' + parameter of a timer now uses the second bit to indicate that this is an + "instant" recording (see FORMATS for details). diff --git a/config.c b/config.c index 53b70262..2b363912 100644 --- a/config.c +++ b/config.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: config.c 1.84 2002/02/17 11:37:05 kls Exp $ + * $Id: config.c 1.85 2002/02/17 15:38:34 kls Exp $ */ #include "config.h" @@ -323,7 +323,7 @@ cTimer::cTimer(bool Instant) { startTime = stopTime = 0; recording = pending = false; - active = Instant; + active = Instant ? taActInst : taInactive; cChannel *ch = Channels.GetByNumber(cDvbApi::CurrentChannel()); channel = ch ? ch->number : 0; time_t t = time(NULL); diff --git a/config.h b/config.h index 60cfafde..393bc77a 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.96 2002/02/17 12:17:29 kls Exp $ + * $Id: config.h 1.97 2002/02/17 15:41:44 kls Exp $ */ #ifndef __CONFIG_H @@ -119,6 +119,12 @@ public: bool Switch(cDvbApi *DvbApi = NULL, bool Log = true); }; +enum eTimerActive { taInactive = 0, + taActive = 1, + taInstant = 2, + taActInst = (taActive | taInstant) + }; + class cTimer : public cListObject { private: time_t startTime, stopTime; diff --git a/menu.c b/menu.c index e12e0157..89bb4ab5 100644 --- a/menu.c +++ b/menu.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: menu.c 1.154 2002/02/17 14:00:54 kls Exp $ + * $Id: menu.c 1.155 2002/02/17 16:03:49 kls Exp $ */ #include "menu.h" @@ -2436,10 +2436,12 @@ cRecordControl::~cRecordControl() delete fileName; } +#define INSTANT_REC_EPG_LOOKAHEAD 300 // seconds to look into the EPG data for an instant recording + bool cRecordControl::GetEventInfo(void) { cChannel *channel = Channels.GetByNumber(timer->channel); - time_t Time = timer->IsSingleEvent() ? timer->StartTime() + ((Setup.MarginStart * 2) + 1) * 60 : timer->StartTime() + (timer->StopTime() - timer->StartTime()) / 2; + time_t Time = timer->active == taActInst ? timer->StartTime() + INSTANT_REC_EPG_LOOKAHEAD : timer->StartTime() + (timer->StopTime() - timer->StartTime()) / 2; for (int seconds = 0; seconds <= MAXWAIT4EPGINFO; seconds++) { { cThreadLock ThreadLock;