summaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <kls (at) cadsoft (dot) de>2002-03-03 18:00:00 +0100
committerKlaus Schmidinger <kls (at) cadsoft (dot) de>2002-03-03 18:00:00 +0100
commita001a4bf97715d62b387d1da9fd1e48382508428 (patch)
tree122e77986a23e2eea92487322e4c943595fdecd7 /config.c
parent0bad88704ba7e0346c49bb28be28e709473d9244 (diff)
downloadvdr-patch-lnbsharing-a001a4bf97715d62b387d1da9fd1e48382508428.tar.gz
vdr-patch-lnbsharing-a001a4bf97715d62b387d1da9fd1e48382508428.tar.bz2
Version 1.0.0pre3vdr-1.0.0pre3
- Fixed parsing 'E' records in epg2html.pl. - Fixed a deadlock when switching channels via Schedule/Now|Next/Switch (reported by Martin Hammerschmid). - Changed the meaning of the 'Ca' parameter in 'channels.conf'. Each channel can now define which decryption method it needs in order to be accessed. The new configuration file 'ca.conf' contains the defined values, and the default 'channels.conf' has been modifed to contain the new values for 'Premiere World' and 'ORF'. If you use the default 'channels.conf' and have the conditional access hardware to receive encrypted channels, please make sure you copy the file 'ca.conf' into your /video directory (or wherever your configuration files are located) and go into the "Setup" menu and set the CICAM values according to your hardware setup. Currently there are two possible CICAM entries per DVB card, so any card can implement up to two different conditional access modes (besides the default "Free To Air" mode, which is always assumed to be available on any DVB card). - Updated French language texts (thanks to Jean-Claude Repetto).
Diffstat (limited to 'config.c')
-rw-r--r--config.c73
1 files changed, 72 insertions, 1 deletions
diff --git a/config.c b/config.c
index 213fe2c..a91cb8a 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.87 2002/02/24 11:59:14 kls Exp $
+ * $Id: config.c 1.88 2002/03/03 16:04:21 kls Exp $
*/
#include "config.h"
@@ -732,6 +732,24 @@ bool cSVDRPhost::Accepts(in_addr_t Address)
return (Address & mask) == addr.s_addr;
}
+// -- cCaDefinition ----------------------------------------------------------
+
+cCaDefinition::cCaDefinition(void)
+{
+ number = 0;
+ description = NULL;
+}
+
+cCaDefinition::~cCaDefinition()
+{
+ delete description;
+}
+
+bool cCaDefinition::Parse(const char *s)
+{
+ return 2 == sscanf(s, "%d %a[^\n]", &number, &description) && description && *description;
+}
+
// -- cKeys ------------------------------------------------------------------
cKeys Keys;
@@ -879,6 +897,21 @@ bool cSVDRPhosts::Acceptable(in_addr_t Address)
return false;
}
+// -- cCaDefinitions ---------------------------------------------------------
+
+cCaDefinitions CaDefinitions;
+
+const cCaDefinition *cCaDefinitions::Get(int Number)
+{
+ cCaDefinition *p = First();
+ while (p) {
+ if (p->Number() == Number)
+ return p;
+ p = (cCaDefinition *)p->Next();
+ }
+ return NULL;
+}
+
// -- cSetup -----------------------------------------------------------------
cSetup Setup;
@@ -921,10 +954,46 @@ cSetup::cSetup(void)
MinUserInactivity = 120;
MultiSpeedMode = 0;
ShowReplayMode = 0;
+ memset(CaCaps, sizeof(CaCaps), 0);
CurrentChannel = -1;
CurrentVolume = MAXVOLUME;
}
+void cSetup::PrintCaCaps(FILE *f, const char *Name)
+{
+ for (int d = 0; d < MAXDVBAPI; d++) {
+ if (CaCaps[d][0]) {
+ fprintf(f, "CaCaps = %d", d + 1);
+ for (int i = 0; i < MAXCACAPS && CaCaps[d][i]; i++)
+ fprintf(f, " %d", CaCaps[d][i]);
+ fprintf(f, "\n");
+ }
+ }
+}
+
+bool cSetup::ParseCaCaps(const char *Value)
+{
+ char *p;
+ int d = strtol(Value, &p, 10);
+ if (d > 0 && d < MAXDVBAPI) {
+ d--;
+ int i = 0;
+ while (p != Value && p && *p) {
+ if (i < MAXCACAPS) {
+ int c = strtol(p, &p, 10);
+ if (c > 0)
+ CaCaps[d][i++] = c;
+ else
+ return false;
+ }
+ else
+ return false;
+ }
+ return true;
+ }
+ return false;
+}
+
bool cSetup::Parse(char *s)
{
char *p = strchr(s, '=');
@@ -967,6 +1036,7 @@ bool cSetup::Parse(char *s)
else if (!strcasecmp(Name, "MinUserInactivity")) MinUserInactivity = atoi(Value);
else if (!strcasecmp(Name, "MultiSpeedMode")) MultiSpeedMode = atoi(Value);
else if (!strcasecmp(Name, "ShowReplayMode")) ShowReplayMode = atoi(Value);
+ else if (!strcasecmp(Name, "CaCaps")) return ParseCaCaps(Value);
else if (!strcasecmp(Name, "CurrentChannel")) CurrentChannel = atoi(Value);
else if (!strcasecmp(Name, "CurrentVolume")) CurrentVolume = atoi(Value);
else
@@ -1047,6 +1117,7 @@ bool cSetup::Save(const char *FileName)
fprintf(f, "MinUserInactivity = %d\n", MinUserInactivity);
fprintf(f, "MultiSpeedMode = %d\n", MultiSpeedMode);
fprintf(f, "ShowReplayMode = %d\n", ShowReplayMode);
+ PrintCaCaps(f, "CaCaps");
fprintf(f, "CurrentChannel = %d\n", CurrentChannel);
fprintf(f, "CurrentVolume = %d\n", CurrentVolume);
if (f.Close()) {