From fb9c1c6a44ee277bc17c17bca5db07e304e556c2 Mon Sep 17 00:00:00 2001 From: Rolf Ahrenberg Date: Sat, 17 May 2014 21:41:55 +0300 Subject: [PATCH] Added a session id quirk for Triax TSS 400. --- HISTORY | 5 +++++ common.c | 9 +++++++++ common.h | 1 + po/ca_ES.po | 6 +++--- po/de_DE.po | 6 +++--- po/es_ES.po | 6 +++--- po/fi_FI.po | 6 +++--- satip.c | 2 +- server.c | 14 ++++++++++---- tuner.c | 2 +- 10 files changed, 39 insertions(+), 18 deletions(-) diff --git a/HISTORY b/HISTORY index 412bb9b..2549762 100644 --- a/HISTORY +++ b/HISTORY @@ -59,3 +59,8 @@ VDR Plugin 'satip' Revision History - Fixed model detection and OctopusNet DVB-C model quirks. - Added a session id quirk for GSSBOX. + +2014-05-18: Version 0.3.3 + +- Added a validity check for the session member. +- Added a session id quirk for Triax TSS 400. diff --git a/common.c b/common.c index 41dc4c2..4206964 100644 --- a/common.c +++ b/common.c @@ -57,6 +57,15 @@ char *StripTags(char *strP) return NULL; } +char *SkipZeroes(const char *strP) +{ + if ((uchar)*strP != '0') + return (char *)strP; + while (*strP && (uchar)*strP == '0') + strP++; + return (char *)strP; +} + cString ChangeCase(const cString &strP, bool upperP) { cString res(strP); diff --git a/common.h b/common.h index 7c51e91..3fec88e 100644 --- a/common.h +++ b/common.h @@ -93,6 +93,7 @@ uint16_t ts_pid(const uint8_t *bufP); uint8_t payload(const uint8_t *bufP); const char *id_pid(const u_short pidP); char *StripTags(char *strP); +char *SkipZeroes(const char *strP); cString ChangeCase(const cString &strP, bool upperP); struct section_filter_table_type { diff --git a/po/ca_ES.po b/po/ca_ES.po index 2289e79..521c59c 100644 --- a/po/ca_ES.po +++ b/po/ca_ES.po @@ -5,10 +5,10 @@ # msgid "" msgstr "" -"Project-Id-Version: vdr-satip 0.3.2\n" +"Project-Id-Version: vdr-satip 0.3.3\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-05-10 05:10+0200\n" -"PO-Revision-Date: 2014-05-10 05:10+0200\n" +"POT-Creation-Date: 2014-05-18 05:18+0200\n" +"PO-Revision-Date: 2014-05-18 05:18+0200\n" "Last-Translator: Gabriel Bonich \n" "Language-Team: Catalan \n" "Language: ca\n" diff --git a/po/de_DE.po b/po/de_DE.po index e1d5960..30bc5a6 100644 --- a/po/de_DE.po +++ b/po/de_DE.po @@ -5,10 +5,10 @@ # msgid "" msgstr "" -"Project-Id-Version: vdr-satip 0.3.2\n" +"Project-Id-Version: vdr-satip 0.3.3\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-05-10 05:10+0200\n" -"PO-Revision-Date: 2014-05-10 05:10+0200\n" +"POT-Creation-Date: 2014-05-18 05:18+0200\n" +"PO-Revision-Date: 2014-05-18 05:18+0200\n" "Last-Translator: Frank Neumann \n" "Language-Team: German \n" "Language: de\n" diff --git a/po/es_ES.po b/po/es_ES.po index b3e02e8..06ca763 100644 --- a/po/es_ES.po +++ b/po/es_ES.po @@ -5,10 +5,10 @@ # msgid "" msgstr "" -"Project-Id-Version: vdr-satip 0.3.2\n" +"Project-Id-Version: vdr-satip 0.3.3\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-05-10 05:10+0200\n" -"PO-Revision-Date: 2014-05-10 05:10+0200\n" +"POT-Creation-Date: 2014-05-18 05:18+0200\n" +"PO-Revision-Date: 2014-05-18 05:18+0200\n" "Last-Translator: Gabriel Bonich \n" "Language-Team: Spanish \n" "Language: es\n" diff --git a/po/fi_FI.po b/po/fi_FI.po index fd77e4b..9601116 100644 --- a/po/fi_FI.po +++ b/po/fi_FI.po @@ -5,10 +5,10 @@ # msgid "" msgstr "" -"Project-Id-Version: vdr-satip 0.3.2\n" +"Project-Id-Version: vdr-satip 0.3.3\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-05-10 05:10+0200\n" -"PO-Revision-Date: 2014-05-10 05:10+0200\n" +"POT-Creation-Date: 2014-05-18 05:18+0200\n" +"PO-Revision-Date: 2014-05-18 05:18+0200\n" "Last-Translator: Rolf Ahrenberg\n" "Language-Team: Finnish \n" "Language: fi\n" diff --git a/satip.c b/satip.c index 00edac6..8f4d110 100644 --- a/satip.c +++ b/satip.c @@ -25,7 +25,7 @@ #define GITVERSION "" #endif - const char VERSION[] = "0.3.2" GITVERSION; + const char VERSION[] = "0.3.3" GITVERSION; static const char DESCRIPTION[] = trNOOP("SAT>IP Devices"); class cPluginSatip : public cPlugin { diff --git a/server.c b/server.c index 27c1a3d..6d852c6 100644 --- a/server.c +++ b/server.c @@ -25,8 +25,14 @@ cSatipServer::cSatipServer(const char *addressP, const char *descriptionP, const memset(modelCountM, 0, sizeof(modelCountM)); if (isempty(*modelM)) modelM = "DVBS-1"; - // Grundig Sat Systems GSS.box DSI 400 has a session id bug - if (strstr(*descriptionM, "GSSBOX")) + // These devices contain a session id bug: + // Inverto Airscreen Server IDL 400 ? + // Telestar Digibit R1 ? + // Elgato EyeTV Netstream 4Sat ? + if (!isempty(*descriptionM) && + (strstr(*descriptionM, "GSSBOX") || // Grundig Sat Systems GSS.box DSI 400 + strstr(*descriptionM, "Triax SatIP Converter") // Triax TSS 400 + )) quirkM |= eSatipQuirkSessionId; char *s, *p = strdup(*modelM); char *r = strtok_r(p, ",", &s); @@ -45,7 +51,7 @@ cSatipServer::cSatipServer(const char *addressP, const char *descriptionP, const else modelCountM[eSatipModuleDVBT2] = 1; // Add model quirks here - if (strstr(*descriptionM, "OctopusNet")) + if (!isempty(*descriptionM) && strstr(*descriptionM, "OctopusNet")) modelTypeM |= cSatipServer::eSatipModelTypeDVBC; } if (strstr(r, "DVBT")) { @@ -55,7 +61,7 @@ cSatipServer::cSatipServer(const char *addressP, const char *descriptionP, const else modelCountM[eSatipModuleDVBT] = 1; // Add model quirks here - if (strstr(*descriptionM, "OctopusNet")) + if (!isempty(*descriptionM) && strstr(*descriptionM, "OctopusNet")) modelTypeM |= cSatipServer::eSatipModelTypeDVBC; } r = strtok_r(NULL, ",", &s); diff --git a/tuner.c b/tuner.c index cbf32ca..3a7ebe7 100644 --- a/tuner.c +++ b/tuner.c @@ -242,7 +242,7 @@ bool cSatipTuner::Connect(void) SATIP_CURL_EASY_SETOPT(handleM, CURLOPT_WRITEHEADER, NULL); if (nextServerM && nextServerM->Quirk(cSatipServer::eSatipQuirkSessionId) && !isempty(*sessionM) && startswith(*sessionM, "0")) { debug("cSatipTuner::%s(): session id quirk [device %d]", __FUNCTION__, deviceM->GetId()); - SATIP_CURL_EASY_SETOPT(handleM, CURLOPT_RTSP_SESSION_ID, *sessionM + 1); + SATIP_CURL_EASY_SETOPT(handleM, CURLOPT_RTSP_SESSION_ID, SkipZeroes(*sessionM)); } if (!ValidateLatestResponse()) return false;