From 278d0478cf6ebea042bdd20c933564ec294ae54e Mon Sep 17 00:00:00 2001 From: Rolf Ahrenberg Date: Sat, 17 Jan 2015 17:29:21 +0200 Subject: [PATCH] Added a command-line option to disable all the SAT>IP server quirks. --- HISTORY | 2 ++ config.c | 1 + config.h | 3 +++ satip.c | 19 ++++++++++++------- server.c | 35 +++++++++++++++++++---------------- 5 files changed, 37 insertions(+), 23 deletions(-) diff --git a/HISTORY b/HISTORY index 1d3c384..d5ac8ae 100644 --- a/HISTORY +++ b/HISTORY @@ -103,3 +103,5 @@ VDR Plugin 'satip' Revision History - Added configurable CI slots. - Fixed parsing of the setup values. - Added an option to disable sources via sources.conf. +- Added a command-line option to disable all the + SAT>IP server quirks. diff --git a/config.c b/config.c index 101f372..a0688cc 100644 --- a/config.c +++ b/config.c @@ -17,6 +17,7 @@ cSatipConfig::cSatipConfig(void) ciExtensionM(0), eitScanM(1), useBytesM(1), + disableServerQuirksM(false), useSingleModelServersM(false) { for (unsigned int i = 0; i < ELEMENTS(cicamsM); ++i) diff --git a/config.h b/config.h index b250dc1..9dcd4fd 100644 --- a/config.h +++ b/config.h @@ -19,6 +19,7 @@ private: unsigned int ciExtensionM; unsigned int eitScanM; unsigned int useBytesM; + bool disableServerQuirksM; bool useSingleModelServersM; int cicamsM[MAX_CICAM_COUNT]; int disabledSourcesM[MAX_DISABLED_SOURCES_COUNT]; @@ -65,6 +66,7 @@ public: int GetCICAM(unsigned int indexP) const; unsigned int GetEITScan(void) const { return eitScanM; } unsigned int GetUseBytes(void) const { return useBytesM; } + bool GetDisableServerQuirks(void) const { return disableServerQuirksM; } bool GetUseSingleModelServers(void) const { return useSingleModelServersM; } unsigned int GetDisabledSourcesCount(void) const; int GetDisabledSources(unsigned int indexP) const; @@ -77,6 +79,7 @@ public: void SetCICAM(unsigned int indexP, int cicamP); void SetEITScan(unsigned int onOffP) { eitScanM = onOffP; } void SetUseBytes(unsigned int onOffP) { useBytesM = onOffP; } + void SetDisableServerQuirks(bool onOffP) { disableServerQuirksM = onOffP; } void SetUseSingleModelServers(bool onOffP) { useSingleModelServersM = onOffP; } void SetDisabledSources(unsigned int indexP, int sourceP); void SetDisabledFilters(unsigned int indexP, int numberP); diff --git a/satip.c b/satip.c index a41e324..47807bb 100644 --- a/satip.c +++ b/satip.c @@ -85,7 +85,8 @@ const char *cPluginSatip::CommandLineHelp(void) " -t , --trace= set the tracing mode\n" " -s ||, --server=||;||\n" " 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[]) @@ -93,16 +94,17 @@ bool cPluginSatip::ProcessArgs(int argc, char *argv[]) debug1("%s", __PRETTY_FUNCTION__); // Implement command line argument processing here if applicable. static const struct option long_options[] = { - { "devices", required_argument, NULL, 'd' }, - { "trace", required_argument, NULL, 't' }, - { "server", required_argument, NULL, 's' }, - { "single", no_argument, NULL, 'S' }, - { NULL, no_argument, NULL, 0 } + { "devices", required_argument, NULL, 'd' }, + { "trace", required_argument, NULL, 't' }, + { "server", required_argument, NULL, 's' }, + { "single", no_argument, NULL, 'S' }, + { "noquirks", no_argument, NULL, 'n' }, + { NULL, no_argument, NULL, 0 } }; cString server; 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) { case 'd': deviceCountM = strtol(optarg, NULL, 0); @@ -116,6 +118,9 @@ bool cPluginSatip::ProcessArgs(int argc, char *argv[]) case 'S': SatipConfig.SetUseSingleModelServers(true); break; + case 'n': + SatipConfig.SetDisableServerQuirks(true); + break; default: return false; } diff --git a/server.c b/server.c index 0584dbb..65113ab 100644 --- a/server.c +++ b/server.c @@ -26,22 +26,25 @@ cSatipServer::cSatipServer(const char *addressP, const char *modelP, const char lastSeenM(0) { memset(modelCountM, 0, sizeof(modelCountM)); - // These devices contain a session id bug: - // Inverto Airscreen Server IDL 400 ? - // Elgato EyeTV Netstream 4Sat ? - if (strstr(*descriptionM, "GSSBOX") || // Grundig Sat Systems GSS.box DSI 400 - strstr(*descriptionM, "DIGIBIT") || // Telestar Digibit R1 - strstr(*descriptionM, "Triax SatIP Converter") // Triax TSS 400 - ) - quirkM |= eSatipQuirkSessionId; - // These devices contain a play (add/delpids) parameter bug: - if (strstr(*descriptionM, "fritzdvbc")) // Fritz!WLAN Repeater DVB-C - quirkM |= eSatipQuirkPlayPids; - // These devices contain a frontend locking bug: - if (strstr(*descriptionM, "fritzdvbc")) // Fritz!WLAN Repeater DVB-C - quirkM |= eSatipQuirkForceLock; - if (quirkM != eSatipQuirkNone) - info("Malfunctioning '%s' server detected! Please, fix the firmware.", *descriptionM); + if (!SatipConfig.GetDisableServerQuirks()) { + debug3("%s quirks=%s", __PRETTY_FUNCTION__, *descriptionM); + // These devices contain a session id bug: + // Inverto Airscreen Server IDL 400 ? + // Elgato EyeTV Netstream 4Sat ? + if (strstr(*descriptionM, "GSSBOX") || // Grundig Sat Systems GSS.box DSI 400 + strstr(*descriptionM, "DIGIBIT") || // Telestar Digibit R1 + strstr(*descriptionM, "Triax SatIP Converter") // Triax TSS 400 + ) + quirkM |= eSatipQuirkSessionId; + // These devices contain a play (add/delpids) parameter bug: + if (strstr(*descriptionM, "fritzdvbc")) // Fritz!WLAN Repeater DVB-C + quirkM |= eSatipQuirkPlayPids; + // These devices contain a frontend locking bug: + if (strstr(*descriptionM, "fritzdvbc")) // Fritz!WLAN Repeater DVB-C + quirkM |= eSatipQuirkForceLock; + if (quirkM != eSatipQuirkNone) + info("Malfunctioning '%s' server detected! Please, fix the firmware.", *descriptionM); + } // These devices support the X_PMT protocol extension if (strstr(*descriptionM, "OctopusNet")) // Digital Devices OctopusNet quirkM |= eSatipQuirkUseXCI;