Added missing CURL timeouts and improved section id scanner.

This commit is contained in:
Rolf Ahrenberg 2014-01-02 21:35:38 +02:00
parent 01b554a2de
commit a4f0bdf737
6 changed files with 33 additions and 12 deletions

View File

@ -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.

10
README
View File

@ -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.

View File

@ -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; \
} \

2
iptv.c
View File

@ -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 {

View File

@ -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;

View File

@ -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)) {