mirror of
https://github.com/VDR4Arch/vdr.git
synced 2023-10-10 13:36:52 +02:00
Implemented PrimaryLimit setup parameter
This commit is contained in:
parent
377b15b535
commit
edacac5f91
3
HISTORY
3
HISTORY
@ -404,3 +404,6 @@ Video Disk Recorder Revision History
|
||||
- Fixed an occasional segfault in the EIT processor.
|
||||
- A value of '0' for the EPGScanTimeout setup parameter now completely turns off
|
||||
scanning for EPG data on both single and multiple card systems.
|
||||
- New setup parameter "PrimaryLimit" that allows to prevent timers from using the
|
||||
primary DVB interface in multi card systems. Default value is 0, which means
|
||||
that every timer may use the primary interface.
|
||||
|
9
MANUAL
9
MANUAL
@ -333,6 +333,15 @@ Video Disk Recorder User's Manual
|
||||
connection after which the connection is automatically
|
||||
closed. Default is 300, a value of 0 means no timeout.
|
||||
|
||||
PrimaryLimit = 0 The minimum priority a timer must have to be allowed to
|
||||
use the primary DVB interface, or to force another timer
|
||||
with higher priority to use the primary DVB interface.
|
||||
This is mainly useful for recordings that should take
|
||||
place only when there is nothing else to do, but should
|
||||
never keep the user from viewing stuff on the primary
|
||||
interface. On systems with only one DVB card, timers
|
||||
with a priority below PrimaryLimit will never execute.
|
||||
|
||||
* Executing system commands
|
||||
|
||||
The "Main" menu option "Commands" allows you to execute any system commands
|
||||
|
5
config.c
5
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.42 2001/02/18 13:11:59 kls Exp $
|
||||
* $Id: config.c 1.43 2001/02/24 13:20:18 kls Exp $
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
@ -739,6 +739,7 @@ cSetup::cSetup(void)
|
||||
MarginStop = 10;
|
||||
EPGScanTimeout = 5;
|
||||
SVDRPTimeout = 300;
|
||||
PrimaryLimit = 0;
|
||||
CurrentChannel = -1;
|
||||
}
|
||||
|
||||
@ -760,6 +761,7 @@ bool cSetup::Parse(char *s)
|
||||
else if (!strcasecmp(Name, "MarginStop")) MarginStop = atoi(Value);
|
||||
else if (!strcasecmp(Name, "EPGScanTimeout")) EPGScanTimeout = atoi(Value);
|
||||
else if (!strcasecmp(Name, "SVDRPTimeout")) SVDRPTimeout = atoi(Value);
|
||||
else if (!strcasecmp(Name, "PrimaryLimit")) PrimaryLimit = atoi(Value);
|
||||
else if (!strcasecmp(Name, "CurrentChannel")) CurrentChannel = atoi(Value);
|
||||
else
|
||||
return false;
|
||||
@ -814,6 +816,7 @@ bool cSetup::Save(const char *FileName)
|
||||
fprintf(f, "MarginStop = %d\n", MarginStop);
|
||||
fprintf(f, "EPGScanTimeout = %d\n", EPGScanTimeout);
|
||||
fprintf(f, "SVDRPTimeout = %d\n", SVDRPTimeout);
|
||||
fprintf(f, "PrimaryLimit = %d\n", PrimaryLimit);
|
||||
fprintf(f, "CurrentChannel = %d\n", CurrentChannel);
|
||||
f.Close();
|
||||
isyslog(LOG_INFO, "saved setup to %s", FileName);
|
||||
|
3
config.h
3
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.41 2001/02/18 13:12:06 kls Exp $
|
||||
* $Id: config.h 1.42 2001/02/24 13:19:39 kls Exp $
|
||||
*/
|
||||
|
||||
#ifndef __CONFIG_H
|
||||
@ -270,6 +270,7 @@ public:
|
||||
int MarginStart, MarginStop;
|
||||
int EPGScanTimeout;
|
||||
int SVDRPTimeout;
|
||||
int PrimaryLimit;
|
||||
int CurrentChannel;
|
||||
cSetup(void);
|
||||
bool Load(const char *FileName);
|
||||
|
20
dvbapi.c
20
dvbapi.c
@ -4,7 +4,7 @@
|
||||
* See the main source file 'vdr.c' for copyright information and
|
||||
* how to reach the author.
|
||||
*
|
||||
* $Id: dvbapi.c 1.60 2001/02/24 12:18:30 kls Exp $
|
||||
* $Id: dvbapi.c 1.61 2001/02/24 13:13:19 kls Exp $
|
||||
*/
|
||||
|
||||
#include "dvbapi.h"
|
||||
@ -1609,7 +1609,7 @@ bool cDvbApi::SetPrimaryDvbApi(int n)
|
||||
|
||||
cDvbApi *cDvbApi::GetDvbApi(int Ca, int Priority)
|
||||
{
|
||||
cDvbApi *d = NULL;
|
||||
cDvbApi *d = NULL, *dMinPriority = NULL;
|
||||
int index = Ca - 1;
|
||||
for (int i = MAXDVBAPI; --i >= 0; ) {
|
||||
if (dvbApi[i]) {
|
||||
@ -1619,13 +1619,25 @@ cDvbApi *cDvbApi::GetDvbApi(int Ca, int Priority)
|
||||
}
|
||||
else if (Ca == 0) { // means any device would be acceptable
|
||||
if (!d || !dvbApi[i]->Recording() || (d->Recording() && d->Priority() > dvbApi[i]->Priority()))
|
||||
d = dvbApi[i];
|
||||
d = dvbApi[i]; // this is one that is either not currently recording or has the lowest priority
|
||||
if (d && d != PrimaryDvbApi && !d->Recording()) // avoids the PrimaryDvbApi if possible
|
||||
break;
|
||||
if (d && d->Recording() && d->Priority() < Setup.PrimaryLimit && (!dMinPriority || d->Priority() < dMinPriority->Priority()))
|
||||
dMinPriority = d; // this is the one with the lowest priority below Setup.PrimaryLimit
|
||||
}
|
||||
}
|
||||
}
|
||||
return (d && (!d->Recording() || d->Priority() < Priority || (!d->Ca() && Ca))) ? d : NULL;
|
||||
if (d == PrimaryDvbApi) { // the PrimaryDvbApi was the only one that was free
|
||||
if (Priority < Setup.PrimaryLimit)
|
||||
return NULL; // not enough priority to use the PrimaryDvbApi
|
||||
if (dMinPriority) // there's one that must not use the PrimaryDvbApi...
|
||||
d = dMinPriority; // ...so let's kick out that one
|
||||
}
|
||||
return (d // we found one...
|
||||
&& (!d->Recording() // ...that's either not currently recording...
|
||||
|| d->Priority() < Priority // ...or has a lower priority...
|
||||
|| (!d->Ca() && Ca))) // ...or doesn't need this card
|
||||
? d : NULL;
|
||||
}
|
||||
|
||||
int cDvbApi::Index(void)
|
||||
|
7
i18n.c
7
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.13 2001/02/18 13:14:00 kls Exp $
|
||||
* $Id: i18n.c 1.14 2001/02/24 13:57:14 kls Exp $
|
||||
*
|
||||
* Slovenian translations provided by Miha Setina <mihasetina@softhome.net>
|
||||
* Italian translations provided by Alberto Carraro <bertocar@tin.it>
|
||||
@ -421,6 +421,11 @@ const tPhrase Phrases[] = {
|
||||
"", // TODO
|
||||
"Timeout SVDRP",
|
||||
},
|
||||
{ "PrimaryLimit",
|
||||
"Primär-Limit",
|
||||
"", // TODO
|
||||
"", // TODO
|
||||
},
|
||||
// The days of the week:
|
||||
{ "MTWTFSS",
|
||||
"MDMDFSS",
|
||||
|
5
menu.c
5
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.66 2001/02/18 13:12:32 kls Exp $
|
||||
* $Id: menu.c 1.67 2001/02/24 14:03:39 kls Exp $
|
||||
*/
|
||||
|
||||
#include "menu.h"
|
||||
@ -1609,6 +1609,7 @@ void cMenuSetup::Set(void)
|
||||
Add(new cMenuEditIntItem( tr("MarginStop"), &data.MarginStop));
|
||||
Add(new cMenuEditIntItem( tr("EPGScanTimeout"), &data.EPGScanTimeout));
|
||||
Add(new cMenuEditIntItem( tr("SVDRPTimeout"), &data.SVDRPTimeout));
|
||||
Add(new cMenuEditIntItem( tr("PrimaryLimit"), &data.PrimaryLimit));
|
||||
}
|
||||
|
||||
eOSState cMenuSetup::ProcessKey(eKeys Key)
|
||||
@ -1996,7 +1997,7 @@ bool cRecordControls::Start(cTimer *Timer)
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
else if (!Timer || Timer->priority >= Setup.PrimaryLimit)
|
||||
esyslog(LOG_ERR, "ERROR: no free DVB device to record channel %d!", ch);
|
||||
}
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user