summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'media-video/vdr/files/1.3.27/vdr-1.3.27-SourceCaps-lnb-sharing.diff')
-rw-r--r--media-video/vdr/files/1.3.27/vdr-1.3.27-SourceCaps-lnb-sharing.diff208
1 files changed, 208 insertions, 0 deletions
diff --git a/media-video/vdr/files/1.3.27/vdr-1.3.27-SourceCaps-lnb-sharing.diff b/media-video/vdr/files/1.3.27/vdr-1.3.27-SourceCaps-lnb-sharing.diff
new file mode 100644
index 000000000000..f9c011352b6d
--- /dev/null
+++ b/media-video/vdr/files/1.3.27/vdr-1.3.27-SourceCaps-lnb-sharing.diff
@@ -0,0 +1,208 @@
+diff -u vdr-1.3.27-before/config.c vdr-1.3.27/config.c
+--- vdr-1.3.27-before/config.c 2005-06-28 23:45:26.000000000 +0200
++++ vdr-1.3.27/config.c 2005-06-28 23:50:08.000000000 +0200
+@@ -14,6 +14,7 @@
+ #include "interface.h"
+ #include "plugin.h"
+ #include "recording.h"
++#include "sources.h"
+
+ // IMPORTANT NOTE: in the 'sscanf()' calls there is a blank after the '%d'
+ // format characters in order to allow any number of blanks after a numeric
+@@ -299,6 +300,7 @@
+ MultiSpeedMode = 0;
+ ShowReplayMode = 0;
+ ResumeID = 0;
++ memset(SourceCaps, 0, sizeof(SourceCaps));
+ CurrentChannel = -1;
+ CurrentVolume = MAXVOLUME;
+ CurrentDolby = 0;
+@@ -370,6 +372,54 @@
+ return false;
+ }
+
++void cSetup::StoreSourceCaps(const char *Name)
++{
++ cSetupLine *l;
++ while ((l = Get(Name)) != NULL)
++ Del(l);
++
++ for(int i = 0; i < MAXDEVICES; i++)
++ {
++ char buffer[MAXPARSEBUFFER]={0,}, *q = buffer;
++ int j = 0;
++ while(SourceCaps[i][j] && j < MAXSOURCECAPS)
++ {
++ if(j==0) q += snprintf(buffer, sizeof(buffer), "%i ", i+1);
++ q += snprintf(q, sizeof(buffer) - (q-buffer), "%s ",
++ *cSource::ToString(SourceCaps[i][j++]));
++ }
++ if(*buffer)
++ Store(Name, buffer, NULL, true);
++ }
++
++}
++
++bool cSetup::ParseSourceCaps(const char *Value)
++{
++ bool erg = true;
++ char *p;
++ int d = strtol(Value, &p, 10), i = 0;
++ d--;
++ while(p<Value+strlen(Value))
++ {
++ if(*p==0) return erg;
++ if(isblank(*p)) ++p;
++ if(isalpha(*p))
++ {
++ int source = cSource::FromString(p);
++ if(source != cSource::stNone)
++ SourceCaps[d][i++] = source;
++ else
++ return false;
++ //printf("SourceCaps[%i][%i] = %i ... p = %s\n", d, i-1, SourceCaps[d][i-1], p);
++ while(!isblank(*p) && *p)
++ ++p;
++ if(i>MAXSOURCECAPS) return false;
++ }
++ }
++ return true;
++}
++
+ void cSetup::StoreLanguages(const char *Name, int *Values)
+ {
+ char buffer[I18nNumLanguages * 4];
+@@ -462,6 +512,7 @@
+ else if (!strcasecmp(Name, "MultiSpeedMode")) MultiSpeedMode = atoi(Value);
+ else if (!strcasecmp(Name, "ShowReplayMode")) ShowReplayMode = atoi(Value);
+ else if (!strcasecmp(Name, "ResumeID")) ResumeID = atoi(Value);
++ else if (!strcasecmp(Name, "SourceCaps")) return ParseSourceCaps(Value);
+ else if (!strcasecmp(Name, "CurrentChannel")) CurrentChannel = atoi(Value);
+ else if (!strcasecmp(Name, "CurrentVolume")) CurrentVolume = atoi(Value);
+ else if (!strcasecmp(Name, "CurrentDolby")) CurrentDolby = atoi(Value);
+@@ -541,6 +592,7 @@
+ Store("MultiSpeedMode", MultiSpeedMode);
+ Store("ShowReplayMode", ShowReplayMode);
+ Store("ResumeID", ResumeID);
++ StoreSourceCaps("SourceCaps");
+ Store("CurrentChannel", CurrentChannel);
+ Store("CurrentVolume", CurrentVolume);
+ Store("CurrentDolby", CurrentDolby);
+diff -u vdr-1.3.27-before/config.h vdr-1.3.27/config.h
+--- vdr-1.3.27-before/config.h 2005-06-28 23:45:26.000000000 +0200
++++ vdr-1.3.27/config.h 2005-06-28 23:50:08.000000000 +0200
+@@ -198,6 +198,8 @@
+ private:
+ void StoreLanguages(const char *Name, int *Values);
+ bool ParseLanguages(const char *Value, int *Values);
++ void StoreSourceCaps(const char *Name);
++ bool ParseSourceCaps(const char *Value);
+ bool Parse(const char *Name, const char *Value);
+ cSetupLine *Get(const char *Name, const char *Plugin = NULL);
+ void Store(const char *Name, const char *Value, const char *Plugin = NULL, bool AllowMultiple = false);
+@@ -253,6 +255,7 @@
+ int MultiSpeedMode;
+ int ShowReplayMode;
+ int ResumeID;
++ int SourceCaps[MAXDEVICES][MAXSOURCECAPS];
+ int CurrentChannel;
+ int CurrentVolume;
+ int CurrentDolby;
+diff -u vdr-1.3.27-before/device.c vdr-1.3.27/device.c
+--- vdr-1.3.27-before/device.c 2005-06-28 23:45:26.000000000 +0200
++++ vdr-1.3.27/device.c 2005-06-28 23:50:08.000000000 +0200
+@@ -187,8 +187,10 @@
+ for (int i = 0; i < MAXRECEIVERS; i++)
+ receiver[i] = NULL;
+
+- if (numDevices < MAXDEVICES)
++ if (numDevices < MAXDEVICES) {
+ device[numDevices++] = this;
++ SetSourceCaps(cardIndex);
++ }
+ else
+ esyslog("ERROR: too many devices!");
+ }
+@@ -430,6 +432,17 @@
+ return d;
+ }
+
++void cDevice::SetSourceCaps(int Index)
++{
++ for (int d = 0; d < numDevices; d++) {
++ if (Index < 0 || Index == device[d]->CardIndex()) {
++ for (int i = 0; i < MAXSOURCECAPS; i++)
++ device[d]->sourceCaps[i] = Setup.SourceCaps[device[d]->CardIndex()][i];
++ }
++ }
++}
++
++
+ void cDevice::Shutdown(void)
+ {
+ primaryDevice = NULL;
+diff -u vdr-1.3.27-before/device.h vdr-1.3.27/device.h
+--- vdr-1.3.27-before/device.h 2005-06-28 23:45:26.000000000 +0200
++++ vdr-1.3.27/device.h 2005-06-28 23:53:14.000000000 +0200
+@@ -23,6 +23,7 @@
+ #include "tools.h"
+
+ #define MAXDEVICES 16 // the maximum number of devices in the system
++#define MAXSOURCECAPS 128 // the maximum number of different sources per device
+ #define MAXPIDHANDLES 64 // the maximum number of different PIDs per device
+ #define MAXRECEIVERS 16 // the maximum number of receivers per device
+ #define MAXVOLUME 255
+@@ -127,7 +128,10 @@
+ ///< given Priority.
+ ///< See ProvidesChannel() for more information on how
+ ///< priorities are handled, and the meaning of NeedsDetachReceivers.
+-
++ static void SetSourceCaps(int Index = -1);
++ ///< Sets the SourceCaps of the given device according to the Setup data.
++ ///< By default the SourceCaps of all devices are set.
++
+ //ML
+ private:
+ char LNBstate; // Frequenzband und Polarisation des DVB-Empfängers
+@@ -152,6 +156,8 @@
+ static int nextCardIndex;
+ int cardIndex;
+ protected:
++ int sourceCaps[MAXSOURCECAPS];
++protected:
+ cDevice(void);
+ virtual ~cDevice();
+ static int NextCardIndex(int n = 0);
+diff -u vdr-1.3.27-before/dvbdevice.c vdr-1.3.27/dvbdevice.c
+--- vdr-1.3.27-before/dvbdevice.c 2005-06-28 23:45:26.000000000 +0200
++++ vdr-1.3.27/dvbdevice.c 2005-06-28 23:50:08.000000000 +0200
+@@ -772,9 +772,16 @@
+ bool cDvbDevice::ProvidesSource(int Source) const
+ {
+ int type = Source & cSource::st_Mask;
++ if(type == cSource::stSat && frontendType == FE_QPSK)
++ {
++ for(int i = 0;i<MAXSOURCECAPS; i++)
++ if(sourceCaps[i] == Source)
++ return true;
++ return false;
++ }
++ else
+ return type == cSource::stNone
+ || type == cSource::stCable && frontendType == FE_QAM
+- || type == cSource::stSat && frontendType == FE_QPSK
+ || type == cSource::stTerr && frontendType == FE_OFDM;
+ }
+
+diff -u vdr-1.3.27-before/sources.c vdr-1.3.27/sources.c
+--- vdr-1.3.27-before/sources.c 2005-06-28 23:45:26.000000000 +0200
++++ vdr-1.3.27/sources.c 2005-06-28 23:50:08.000000000 +0200
+@@ -68,7 +68,7 @@
+ int pos = 0;
+ bool dot = false;
+ bool neg = false;
+- while (*++s) {
++ while (*++s && !isblank(*s)) {
+ switch (toupper(*s)) {
+ case '0' ... '9': pos *= 10;
+ pos += *s - '0';