summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--HISTORY3
-rw-r--r--config.c7
-rw-r--r--config.h4
-rw-r--r--menu.c10
-rw-r--r--menu.h6
-rw-r--r--vdr.c7
6 files changed, 20 insertions, 17 deletions
diff --git a/HISTORY b/HISTORY
index dbf594b9..6980653a 100644
--- a/HISTORY
+++ b/HISTORY
@@ -691,3 +691,6 @@ Video Disk Recorder Revision History
also copied.
- When a recording is running on the primary interface, any attempt to change
the current channel will now lead to a "Channel locked" message.
+- The main program loop now first checks whether any timer recordings are
+ finished, before starting a new timer recording. This is important in case
+ one timer ends at the same time another timer starts.
diff --git a/config.c b/config.c
index 4ae79d26..102bad16 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.61 2001/09/01 10:02:21 kls Exp $
+ * $Id: config.c 1.62 2001/09/01 15:04:14 kls Exp $
*/
#include "config.h"
@@ -571,7 +571,7 @@ bool cTimer::Matches(time_t t)
}
}
}
- return active && startTime <= t && t <= stopTime;
+ return active && startTime <= t && t < stopTime; // must stop *before* stopTime to allow adjacent timers
}
time_t cTimer::StartTime(void)
@@ -762,9 +762,8 @@ cTimer *cTimers::GetTimer(cTimer *Timer)
return NULL;
}
-cTimer *cTimers::GetMatch(void)
+cTimer *cTimers::GetMatch(time_t t)
{
- time_t t = time(NULL); // all timers must be checked against the exact same time to correctly handle Priority!
cTimer *t0 = NULL;
cTimer *ti = First();
while (ti) {
diff --git a/config.h b/config.h
index fa0794b9..5b41641d 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.68 2001/09/01 10:01:51 kls Exp $
+ * $Id: config.h 1.69 2001/09/01 14:56:06 kls Exp $
*/
#ifndef __CONFIG_H
@@ -256,7 +256,7 @@ public:
class cTimers : public cConfig<cTimer> {
public:
cTimer *GetTimer(cTimer *Timer);
- cTimer *GetMatch(void);
+ cTimer *GetMatch(time_t t);
cTimer *GetNextActiveTimer(void);
};
diff --git a/menu.c b/menu.c
index 1507b676..65e2d0ba 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.110 2001/08/31 13:47:28 kls Exp $
+ * $Id: menu.c 1.111 2001/09/01 14:56:31 kls Exp $
*/
#include "menu.h"
@@ -2163,9 +2163,9 @@ void cRecordControl::Stop(bool KeepInstant)
}
}
-bool cRecordControl::Process(void)
+bool cRecordControl::Process(time_t t)
{
- if (!timer || !timer->Matches())
+ if (!timer || !timer->Matches(t))
return false;
AssertFreeDiskSpace(timer->priority);
return true;
@@ -2235,11 +2235,11 @@ const char *cRecordControls::GetInstantId(const char *LastInstantId)
return NULL;
}
-void cRecordControls::Process(void)
+void cRecordControls::Process(time_t t)
{
for (int i = 0; i < MAXDVBAPI; i++) {
if (RecordControls[i]) {
- if (!RecordControls[i]->Process())
+ if (!RecordControls[i]->Process(t))
DELETENULL(RecordControls[i]);
}
}
diff --git a/menu.h b/menu.h
index 58cc8469..2c5ed394 100644
--- a/menu.h
+++ b/menu.h
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: menu.h 1.24 2001/08/19 14:44:32 kls Exp $
+ * $Id: menu.h 1.25 2001/09/01 14:52:48 kls Exp $
*/
#ifndef _MENU_H
@@ -78,7 +78,7 @@ private:
public:
cRecordControl(cDvbApi *DvbApi, cTimer *Timer = NULL);
virtual ~cRecordControl();
- bool Process(void);
+ bool Process(time_t t);
bool Uses(cDvbApi *DvbApi) { return DvbApi == dvbApi; }
void Stop(bool KeepInstant = false);
bool IsInstant(void) { return instantId; }
@@ -93,7 +93,7 @@ public:
static void Stop(const char *InstantId);
static void Stop(cDvbApi *DvbApi);
static const char *GetInstantId(const char *LastInstantId);
- static void Process(void);
+ static void Process(time_t t);
static bool Active(void);
};
diff --git a/vdr.c b/vdr.c
index 0a93d4bb..efb5e1c3 100644
--- a/vdr.c
+++ b/vdr.c
@@ -22,7 +22,7 @@
*
* The project's page is at http://www.cadsoft.de/people/kls/vdr
*
- * $Id: vdr.c 1.67 2001/09/01 13:48:44 kls Exp $
+ * $Id: vdr.c 1.68 2001/09/01 14:50:40 kls Exp $
*/
#define _GNU_SOURCE
@@ -333,12 +333,13 @@ int main(int argc, char *argv[])
}
// Timers and Recordings:
if (!Menu) {
- cTimer *Timer = Timers.GetMatch();
+ time_t Now = time(NULL); // must do both following calls with the exact same time!
+ cRecordControls::Process(Now);
+ cTimer *Timer = Timers.GetMatch(Now);
if (Timer) {
if (!cRecordControls::Start(Timer))
Timer->SetPending(true);
}
- cRecordControls::Process();
}
// User Input:
cOsdBase **Interact = Menu ? &Menu : (cOsdBase **)&ReplayControl;