1
0
mirror of https://github.com/rofafor/vdr-plugin-satip.git synced 2023-10-10 13:37:42 +02:00

Added a command-line option to disable all the SAT>IP server quirks.

This commit is contained in:
Rolf Ahrenberg 2015-01-17 17:29:21 +02:00
parent 9989c36eee
commit 278d0478cf
5 changed files with 37 additions and 23 deletions

View File

@ -103,3 +103,5 @@ VDR Plugin 'satip' Revision History
- Added configurable CI slots. - Added configurable CI slots.
- Fixed parsing of the setup values. - Fixed parsing of the setup values.
- Added an option to disable sources via sources.conf. - Added an option to disable sources via sources.conf.
- Added a command-line option to disable all the
SAT>IP server quirks.

View File

@ -17,6 +17,7 @@ cSatipConfig::cSatipConfig(void)
ciExtensionM(0), ciExtensionM(0),
eitScanM(1), eitScanM(1),
useBytesM(1), useBytesM(1),
disableServerQuirksM(false),
useSingleModelServersM(false) useSingleModelServersM(false)
{ {
for (unsigned int i = 0; i < ELEMENTS(cicamsM); ++i) for (unsigned int i = 0; i < ELEMENTS(cicamsM); ++i)

View File

@ -19,6 +19,7 @@ private:
unsigned int ciExtensionM; unsigned int ciExtensionM;
unsigned int eitScanM; unsigned int eitScanM;
unsigned int useBytesM; unsigned int useBytesM;
bool disableServerQuirksM;
bool useSingleModelServersM; bool useSingleModelServersM;
int cicamsM[MAX_CICAM_COUNT]; int cicamsM[MAX_CICAM_COUNT];
int disabledSourcesM[MAX_DISABLED_SOURCES_COUNT]; int disabledSourcesM[MAX_DISABLED_SOURCES_COUNT];
@ -65,6 +66,7 @@ public:
int GetCICAM(unsigned int indexP) const; int GetCICAM(unsigned int indexP) const;
unsigned int GetEITScan(void) const { return eitScanM; } unsigned int GetEITScan(void) const { return eitScanM; }
unsigned int GetUseBytes(void) const { return useBytesM; } unsigned int GetUseBytes(void) const { return useBytesM; }
bool GetDisableServerQuirks(void) const { return disableServerQuirksM; }
bool GetUseSingleModelServers(void) const { return useSingleModelServersM; } bool GetUseSingleModelServers(void) const { return useSingleModelServersM; }
unsigned int GetDisabledSourcesCount(void) const; unsigned int GetDisabledSourcesCount(void) const;
int GetDisabledSources(unsigned int indexP) const; int GetDisabledSources(unsigned int indexP) const;
@ -77,6 +79,7 @@ public:
void SetCICAM(unsigned int indexP, int cicamP); void SetCICAM(unsigned int indexP, int cicamP);
void SetEITScan(unsigned int onOffP) { eitScanM = onOffP; } void SetEITScan(unsigned int onOffP) { eitScanM = onOffP; }
void SetUseBytes(unsigned int onOffP) { useBytesM = onOffP; } void SetUseBytes(unsigned int onOffP) { useBytesM = onOffP; }
void SetDisableServerQuirks(bool onOffP) { disableServerQuirksM = onOffP; }
void SetUseSingleModelServers(bool onOffP) { useSingleModelServersM = onOffP; } void SetUseSingleModelServers(bool onOffP) { useSingleModelServersM = onOffP; }
void SetDisabledSources(unsigned int indexP, int sourceP); void SetDisabledSources(unsigned int indexP, int sourceP);
void SetDisabledFilters(unsigned int indexP, int numberP); void SetDisabledFilters(unsigned int indexP, int numberP);

View File

@ -85,7 +85,8 @@ const char *cPluginSatip::CommandLineHelp(void)
" -t <mode>, --trace=<mode> set the tracing mode\n" " -t <mode>, --trace=<mode> set the tracing mode\n"
" -s <ipaddr>|<model>|<desc>, --server=<ipaddr1>|<model1>|<desc1>;<ipaddr2>|<model2>|<desc2>\n" " -s <ipaddr>|<model>|<desc>, --server=<ipaddr1>|<model1>|<desc1>;<ipaddr2>|<model2>|<desc2>\n"
" define hard-coded SAT>IP server(s)" " define hard-coded SAT>IP server(s)"
" -S, --single set the single model server mode on/off\n"; " -S, --single set the single model server mode on\n"
" -n, --noquirks disable all the server quirks\n";
} }
bool cPluginSatip::ProcessArgs(int argc, char *argv[]) bool cPluginSatip::ProcessArgs(int argc, char *argv[])
@ -97,12 +98,13 @@ bool cPluginSatip::ProcessArgs(int argc, char *argv[])
{ "trace", required_argument, NULL, 't' }, { "trace", required_argument, NULL, 't' },
{ "server", required_argument, NULL, 's' }, { "server", required_argument, NULL, 's' },
{ "single", no_argument, NULL, 'S' }, { "single", no_argument, NULL, 'S' },
{ "noquirks", no_argument, NULL, 'n' },
{ NULL, no_argument, NULL, 0 } { NULL, no_argument, NULL, 0 }
}; };
cString server; cString server;
int c; int c;
while ((c = getopt_long(argc, argv, "d:t:s:S", long_options, NULL)) != -1) { while ((c = getopt_long(argc, argv, "d:t:s:Sn", long_options, NULL)) != -1) {
switch (c) { switch (c) {
case 'd': case 'd':
deviceCountM = strtol(optarg, NULL, 0); deviceCountM = strtol(optarg, NULL, 0);
@ -116,6 +118,9 @@ bool cPluginSatip::ProcessArgs(int argc, char *argv[])
case 'S': case 'S':
SatipConfig.SetUseSingleModelServers(true); SatipConfig.SetUseSingleModelServers(true);
break; break;
case 'n':
SatipConfig.SetDisableServerQuirks(true);
break;
default: default:
return false; return false;
} }

View File

@ -26,6 +26,8 @@ cSatipServer::cSatipServer(const char *addressP, const char *modelP, const char
lastSeenM(0) lastSeenM(0)
{ {
memset(modelCountM, 0, sizeof(modelCountM)); memset(modelCountM, 0, sizeof(modelCountM));
if (!SatipConfig.GetDisableServerQuirks()) {
debug3("%s quirks=%s", __PRETTY_FUNCTION__, *descriptionM);
// These devices contain a session id bug: // These devices contain a session id bug:
// Inverto Airscreen Server IDL 400 ? // Inverto Airscreen Server IDL 400 ?
// Elgato EyeTV Netstream 4Sat ? // Elgato EyeTV Netstream 4Sat ?
@ -42,6 +44,7 @@ cSatipServer::cSatipServer(const char *addressP, const char *modelP, const char
quirkM |= eSatipQuirkForceLock; quirkM |= eSatipQuirkForceLock;
if (quirkM != eSatipQuirkNone) if (quirkM != eSatipQuirkNone)
info("Malfunctioning '%s' server detected! Please, fix the firmware.", *descriptionM); info("Malfunctioning '%s' server detected! Please, fix the firmware.", *descriptionM);
}
// These devices support the X_PMT protocol extension // These devices support the X_PMT protocol extension
if (strstr(*descriptionM, "OctopusNet")) // Digital Devices OctopusNet if (strstr(*descriptionM, "OctopusNet")) // Digital Devices OctopusNet
quirkM |= eSatipQuirkUseXCI; quirkM |= eSatipQuirkUseXCI;