1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00

If there is no free DVB device to record, the log message will now be given only once

This commit is contained in:
Klaus Schmidinger 2001-08-11 15:48:54 +02:00
parent 0b73f060d0
commit f7fff8b7be
5 changed files with 21 additions and 13 deletions

View File

@ -622,7 +622,7 @@ Video Disk Recorder Revision History
- Fixed calculating the timeout value in cFile::FileReady() (thanks to - Fixed calculating the timeout value in cFile::FileReady() (thanks to
Wolfgang Henselmann-Weiss). Wolfgang Henselmann-Weiss).
2001-08-10: Version 0.91 2001-08-11: Version 0.91
- Fixed displaying colored button texts that are too long. - Fixed displaying colored button texts that are too long.
- Suppressing replay progress display when replaying a DVD. - Suppressing replay progress display when replaying a DVD.
@ -646,3 +646,5 @@ Video Disk Recorder Revision History
See the description of the "Red" key in MANUAL under "Replay Control" for See the description of the "Red" key in MANUAL under "Replay Control" for
details. details.
- Fixed displaying editing marks when toggling a mark in "pause" mode. - Fixed displaying editing marks when toggling a mark in "pause" mode.
- If there is no free DVB device to record, the log message will now be given
only once.

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: config.c 1.53 2001/08/11 08:38:11 kls Exp $ * $Id: config.c 1.54 2001/08/11 15:34:42 kls Exp $
*/ */
#include "config.h" #include "config.h"
@ -320,7 +320,7 @@ char *cTimer::buffer = NULL;
cTimer::cTimer(bool Instant) cTimer::cTimer(bool Instant)
{ {
startTime = stopTime = 0; startTime = stopTime = 0;
recording = false; recording = pending = false;
active = Instant; active = Instant;
cChannel *ch = Channels.GetByNumber(cDvbApi::CurrentChannel()); cChannel *ch = Channels.GetByNumber(cDvbApi::CurrentChannel());
channel = ch ? ch->number : 0; channel = ch ? ch->number : 0;
@ -343,7 +343,7 @@ cTimer::cTimer(bool Instant)
cTimer::cTimer(const cEventInfo *EventInfo) cTimer::cTimer(const cEventInfo *EventInfo)
{ {
startTime = stopTime = 0; startTime = stopTime = 0;
recording = false; recording = pending = false;
active = true; active = true;
cChannel *ch = Channels.GetByServiceID(EventInfo->GetServiceID()); cChannel *ch = Channels.GetByServiceID(EventInfo->GetServiceID());
channel = ch ? ch->number : 0; channel = ch ? ch->number : 0;
@ -570,6 +570,11 @@ void cTimer::SetRecording(bool Recording)
isyslog(LOG_INFO, "timer %d %s", Index() + 1, recording ? "start" : "stop"); isyslog(LOG_INFO, "timer %d %s", Index() + 1, recording ? "start" : "stop");
} }
void cTimer::SetPending(bool Pending)
{
pending = Pending;
}
cTimer *cTimer::GetMatch(void) cTimer *cTimer::GetMatch(void)
{ {
time_t t = time(NULL); // all timers must be checked against the exact same time to correctly handle Priority! time_t t = time(NULL); // all timers must be checked against the exact same time to correctly handle Priority!

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: config.h 1.58 2001/08/10 12:40:43 kls Exp $ * $Id: config.h 1.59 2001/08/11 15:28:21 kls Exp $
*/ */
#ifndef __CONFIG_H #ifndef __CONFIG_H
@ -122,7 +122,7 @@ private:
static const char *ToText(cTimer *Timer); static const char *ToText(cTimer *Timer);
public: public:
enum { MaxFileName = 256 }; enum { MaxFileName = 256 };
bool recording; bool recording, pending;
int active; int active;
int channel; int channel;
int day; int day;
@ -145,6 +145,7 @@ public:
time_t StartTime(void); time_t StartTime(void);
time_t StopTime(void); time_t StopTime(void);
void SetRecording(bool Recording); void SetRecording(bool Recording);
void SetPending(bool Pending);
static cTimer *GetMatch(void); static cTimer *GetMatch(void);
static int TimeToInt(int t); static int TimeToInt(int t);
static time_t Day(time_t t); static time_t Day(time_t t);

7
menu.c
View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: menu.c 1.101 2001/08/11 15:04:05 kls Exp $ * $Id: menu.c 1.102 2001/08/11 15:47:23 kls Exp $
*/ */
#include "menu.h" #include "menu.h"
@ -2072,6 +2072,7 @@ cRecordControl::cRecordControl(cDvbApi *DvbApi, cTimer *Timer)
Timers.Save(); Timers.Save();
asprintf(&instantId, cDvbApi::NumDvbApis > 1 ? "%s - %d" : "%s", Channels.GetChannelNameByNumber(timer->channel), dvbApi->CardIndex() + 1); asprintf(&instantId, cDvbApi::NumDvbApis > 1 ? "%s - %d" : "%s", Channels.GetChannelNameByNumber(timer->channel), dvbApi->CardIndex() + 1);
} }
timer->SetPending(true);
timer->SetRecording(true); timer->SetRecording(true);
if (Channels.SwitchTo(timer->channel, dvbApi)) { if (Channels.SwitchTo(timer->channel, dvbApi)) {
cRecording Recording(timer); cRecording Recording(timer);
@ -2134,8 +2135,8 @@ bool cRecordControls::Start(cTimer *Timer)
} }
} }
} }
else if (!Timer || Timer->priority >= Setup.PrimaryLimit) else if (!Timer || (Timer->priority >= Setup.PrimaryLimit && !Timer->pending))
esyslog(LOG_ERR, "ERROR: no free DVB device to record channel %d!", ch); isyslog(LOG_ERR, "no free DVB device to record channel %d!", ch);
} }
else else
esyslog(LOG_ERR, "ERROR: channel %d not defined!", ch); esyslog(LOG_ERR, "ERROR: channel %d not defined!", ch);

7
vdr.c
View File

@ -22,7 +22,7 @@
* *
* The project's page is at http://www.cadsoft.de/people/kls/vdr * The project's page is at http://www.cadsoft.de/people/kls/vdr
* *
* $Id: vdr.c 1.62 2001/08/11 09:38:12 kls Exp $ * $Id: vdr.c 1.63 2001/08/11 15:33:30 kls Exp $
*/ */
#include <getopt.h> #include <getopt.h>
@ -325,9 +325,8 @@ int main(int argc, char *argv[])
if (!Menu) { if (!Menu) {
cTimer *Timer = cTimer::GetMatch(); cTimer *Timer = cTimer::GetMatch();
if (Timer) { if (Timer) {
if (!cRecordControls::Start(Timer)) { if (!cRecordControls::Start(Timer))
//TODO need to do something to prevent the timer from hitting over and over again... Timer->SetPending(true);
}
} }
cRecordControls::Process(); cRecordControls::Process();
} }