diff --git a/HISTORY b/HISTORY index d7616c7..8b8cf7c 100644 --- a/HISTORY +++ b/HISTORY @@ -212,3 +212,8 @@ VDR Plugin 'iptv' Revision History - Fixed a nasty network byte order bug. - Fixed and refactored the section filtering code. - Fixed a possible crash in the file protocol. + +2014-xx-xx: Versoin 2.0.1 + +- Added missing CURL timeouts. +- Improved section id scanner. diff --git a/README b/README index 9b64d3a..fc72cba 100644 --- a/README +++ b/README @@ -165,8 +165,7 @@ Notes: "disable_ca_updates" patch to the VDR in order to get rid of "Channel not available" messages. -- EIT scanning functionality can be disabled for all IPTV channels by applying - the "disable_eitscan" patch to the VDR. +- EIT scanning functionality is disabled by default. - Section id and pid scanners should be disabled after the correct data is found. This can be made via VDR's channel editor. @@ -180,7 +179,12 @@ Notes: netrc configuration file for authentication: $(CONFDIR)/iptv/netrc -- CURL implementation +- You can quite easily figure out correct DVB triplet values by using the + multicat and dvbsnoop tools: + $ multicat -u -d 1620000000 @127.0.0.1:1234 /tmp/video.ts + $ dvbsnoop -s ts -if /tmp/video.ts -tssubdecode -hexdumpbuffer 0x12 | \ + grep -m1 -A8 Service_ID | grep _ID + Acknowledgements: - The IPTV section filtering code is derived from Linux kernel. diff --git a/common.h b/common.h index 35e1e47..95e631d 100644 --- a/common.h +++ b/common.h @@ -44,7 +44,8 @@ do { \ if (exp) { \ char tmp[64]; \ - error(errstr": %s", strerror_r(errno, tmp, sizeof(tmp))); \ + error("[%s,%d]: "errstr": %s", __FILE__, __LINE__, \ + strerror_r(errno, tmp, sizeof(tmp))); \ func; \ ret; \ } \ diff --git a/iptv.c b/iptv.c index 8158e67..3815c4e 100644 --- a/iptv.c +++ b/iptv.c @@ -21,7 +21,7 @@ #define GITVERSION "" #endif - const char VERSION[] = "2.0.0" GITVERSION; + const char VERSION[] = "2.0.1" GITVERSION; static const char DESCRIPTION[] = trNOOP("Experience the IPTV"); class cPluginIptv : public cPlugin { diff --git a/protocolcurl.c b/protocolcurl.c index b1ac20b..1581cb3 100644 --- a/protocolcurl.c +++ b/protocolcurl.c @@ -15,12 +15,12 @@ #define iptv_curl_easy_setopt(X, Y, Z) \ if ((res = curl_easy_setopt((X), (Y), (Z))) != CURLE_OK) { \ - error("curl_easy_setopt(%s, %s, %s) failed: %d", #X, #Y, #Z, res); \ + error("curl_easy_setopt(%s, %s) failed: %s (%d)", #Y, #Z, curl_easy_strerror(res), res); \ } #define iptv_curl_easy_perform(X) \ if ((res = curl_easy_perform((X))) != CURLE_OK) { \ - error("curl_easy_perform(%s) failed: %d", #X, res); \ + error("curl_easy_perform() failed: %s (%d)", curl_easy_strerror(res), res); \ } cIptvProtocolCurl::cIptvProtocolCurl() @@ -264,7 +264,8 @@ bool cIptvProtocolCurl::Connect() iptv_curl_easy_setopt(handleM, CURLOPT_NETRC, (long)CURL_NETRC_OPTIONAL); iptv_curl_easy_setopt(handleM, CURLOPT_NETRC_FILE, *netrc); - // Set timeout + // Set timeouts + iptv_curl_easy_setopt(handleM, CURLOPT_TIMEOUT, (long)eConnectTimeoutS); iptv_curl_easy_setopt(handleM, CURLOPT_CONNECTTIMEOUT, (long)eConnectTimeoutS); // Set user-agent @@ -345,6 +346,10 @@ bool cIptvProtocolCurl::Connect() break; case eModeFile: + // Set timeout + iptv_curl_easy_setopt(handleM, CURLOPT_TIMEOUT_MS, 10L); + break; + case eModeUnknown: default: break; diff --git a/sidscanner.c b/sidscanner.c index c989561..fc626ea 100644 --- a/sidscanner.c +++ b/sidscanner.c @@ -71,15 +71,21 @@ void cSidScanner::Process(u_short pidP, u_char tidP, const u_char *dataP, int le if (ts.getTransportStreamId() != channelIdM.Tid()) { debug("cSidScanner::%s(): tsid=%d", __FUNCTION__, ts.getTransportStreamId()); newTid = ts.getTransportStreamId(); + tidFoundM = true; + } + if (ts.getOriginalNetworkId() != channelIdM.Nid()) { + debug("cSidScanner::%s(): onid=%d", __FUNCTION__, ts.getOriginalNetworkId()); + newNid = ts.getOriginalNetworkId(); + nidFoundM = true; } - tidFoundM = true; break; // default to the first one } - if (nit.getNetworkId() != channelIdM.Nid()) { - debug("cSidScanner::%s(): nid=%d", __FUNCTION__, ts.getTransportStreamId()); + // fallback for network id if not found already + if (!nidFoundM && (nit.getNetworkId() != channelIdM.Nid())) { + debug("cSidScanner::%s(): nid=%d", __FUNCTION__, nit.getNetworkId()); newNid = nit.getNetworkId(); + nidFoundM = true; } - nidFoundM = true; } } if ((newSid >= 0) || (newNid >= 0) || (newTid >= 0)) {