mirror of
https://github.com/rofafor/vdr-plugin-iptv.git
synced 2023-10-10 11:37:03 +00:00
Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3f3ba2ad1a | ||
|
|
a4b9570ae6 | ||
|
|
767b1bdac7 | ||
|
|
6f648401a4 | ||
|
|
b0995c9a9e | ||
|
|
412af81271 | ||
|
|
43326bb4ea | ||
|
|
555c08bd4d | ||
|
|
5ad3103626 | ||
|
|
a4f0bdf737 |
8
HISTORY
8
HISTORY
@@ -212,3 +212,11 @@ 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-01-10: Version 2.0.1
|
||||
|
||||
- Added missing CURL timeouts.
|
||||
- Improved section id scanner.
|
||||
- Added support for cDevice::IsTunedToTransponder() and
|
||||
cDevice::GetCurrentlyTunedTransponder().
|
||||
- Fixed a memory leak and some issues reported by scan-build.
|
||||
|
||||
2
Makefile
2
Makefile
@@ -28,7 +28,7 @@ GITTAG = $(shell git describe --always 2>/dev/null)
|
||||
### The directory environment:
|
||||
|
||||
# Use package data if installed...otherwise assume we're under the VDR source directory:
|
||||
PKGCFG = $(if $(VDRDIR),$(shell pkg-config --variable=$(1) $(VDRDIR)/vdr.pc),$(shell pkg-config --variable=$(1) vdr || pkg-config --variable=$(1) ../../../vdr.pc))
|
||||
PKGCFG = $(if $(VDRDIR),$(shell pkg-config --variable=$(1) $(VDRDIR)/vdr.pc),$(shell PKG_CONFIG_PATH="$$PKG_CONFIG_PATH:../../.." pkg-config --variable=$(1) vdr))
|
||||
LIBDIR = $(call PKGCFG,libdir)
|
||||
LOCDIR = $(call PKGCFG,locdir)
|
||||
PLGCFG = $(call PKGCFG,plgcfg)
|
||||
|
||||
10
README
10
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.
|
||||
|
||||
3
common.h
3
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; \
|
||||
} \
|
||||
|
||||
40
device.c
40
device.c
@@ -20,7 +20,7 @@ cIptvDevice::cIptvDevice(unsigned int indexP)
|
||||
isOpenDvrM(false),
|
||||
sidScanEnabledM(false),
|
||||
pidScanEnabledM(false),
|
||||
channelIdM(tChannelID::InvalidID)
|
||||
channelM()
|
||||
{
|
||||
unsigned int bufsize = (unsigned int)MEGABYTE(IptvConfig.GetTsBufferSize());
|
||||
bufsize -= (bufsize % TS_SIZE);
|
||||
@@ -58,18 +58,18 @@ cIptvDevice::cIptvDevice(unsigned int indexP)
|
||||
cIptvDevice::~cIptvDevice()
|
||||
{
|
||||
debug("cIptvDevice::%s(%d)", __FUNCTION__, deviceIndexM);
|
||||
DELETE_POINTER(pIptvStreamerM);
|
||||
DELETE_POINTER(pUdpProtocolM);
|
||||
DELETE_POINTER(pCurlProtocolM);
|
||||
DELETE_POINTER(pHttpProtocolM);
|
||||
DELETE_POINTER(pFileProtocolM);
|
||||
DELETE_POINTER(pExtProtocolM);
|
||||
DELETE_POINTER(tsBufferM);
|
||||
DELETE_POINTER(pPidScannerM);
|
||||
DELETE_POINTER(pSidScannerM);
|
||||
// Stop section handler of iptv device
|
||||
StopSectionHandler();
|
||||
DELETE_POINTER(pIptvSectionM);
|
||||
DELETE_POINTER(pSidScannerM);
|
||||
DELETE_POINTER(pPidScannerM);
|
||||
DELETE_POINTER(pIptvStreamerM);
|
||||
DELETE_POINTER(pExtProtocolM);
|
||||
DELETE_POINTER(pFileProtocolM);
|
||||
DELETE_POINTER(pHttpProtocolM);
|
||||
DELETE_POINTER(pCurlProtocolM);
|
||||
DELETE_POINTER(pUdpProtocolM);
|
||||
DELETE_POINTER(tsBufferM);
|
||||
// Close dvr fifo
|
||||
if (dvrFdM >= 0) {
|
||||
int fd = dvrFdM;
|
||||
@@ -214,7 +214,7 @@ bool cIptvDevice::ProvidesChannel(const cChannel *channelP, int priorityP, bool
|
||||
if (channelP && ProvidesTransponder(channelP)) {
|
||||
result = hasPriority;
|
||||
if (Receiving()) {
|
||||
if (channelP->GetChannelID() == channelIdM)
|
||||
if (channelP->GetChannelID() == channelM.GetChannelID())
|
||||
result = true;
|
||||
else
|
||||
needsDetachReceivers = Receiving();
|
||||
@@ -235,6 +235,16 @@ int cIptvDevice::NumProvidedSystems(void) const
|
||||
return 1;
|
||||
}
|
||||
|
||||
const cChannel *cIptvDevice::GetCurrentlyTunedTransponder(void) const
|
||||
{
|
||||
return &channelM;
|
||||
}
|
||||
|
||||
bool cIptvDevice::IsTunedToTransponder(const cChannel *channelP) const
|
||||
{
|
||||
return channelP ? (channelP->GetChannelID() == channelM.GetChannelID()) : false;
|
||||
}
|
||||
|
||||
bool cIptvDevice::SetChannelDevice(const cChannel *channelP, bool liveViewP)
|
||||
{
|
||||
cIptvProtocolIf *protocol;
|
||||
@@ -270,11 +280,11 @@ bool cIptvDevice::SetChannelDevice(const cChannel *channelP, bool liveViewP)
|
||||
sidScanEnabledM = itp.SidScan() ? true : false;
|
||||
pidScanEnabledM = itp.PidScan() ? true : false;
|
||||
if (pIptvStreamerM->Set(itp.Address(), itp.Parameter(), deviceIndexM, protocol)) {
|
||||
channelIdM = channelP->GetChannelID();
|
||||
channelM = *channelP;
|
||||
if (sidScanEnabledM && pSidScannerM && IptvConfig.GetSectionFiltering())
|
||||
pSidScannerM->SetChannel(channelIdM);
|
||||
pSidScannerM->SetChannel(channelM.GetChannelID());
|
||||
if (pidScanEnabledM && pPidScannerM)
|
||||
pPidScannerM->SetChannel(channelIdM);
|
||||
pPidScannerM->SetChannel(channelM.GetChannelID());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -317,7 +327,7 @@ bool cIptvDevice::OpenDvr(void)
|
||||
void cIptvDevice::CloseDvr(void)
|
||||
{
|
||||
debug("cIptvDevice::%s(%d)", __FUNCTION__, deviceIndexM);
|
||||
if (sidScanEnabledM && pSidScannerM )
|
||||
if (sidScanEnabledM && pSidScannerM)
|
||||
pSidScannerM->Close();
|
||||
if (pIptvStreamerM)
|
||||
pIptvStreamerM->Close();
|
||||
|
||||
4
device.h
4
device.h
@@ -40,7 +40,7 @@ private:
|
||||
bool pidScanEnabledM;
|
||||
cRingBufferLinear *tsBufferM;
|
||||
mutable int tsBufferPrefillM;
|
||||
tChannelID channelIdM;
|
||||
cChannel channelM;
|
||||
cIptvProtocolUdp *pUdpProtocolM;
|
||||
cIptvProtocolCurl *pCurlProtocolM;
|
||||
cIptvProtocolHttp *pHttpProtocolM;
|
||||
@@ -87,6 +87,8 @@ public:
|
||||
virtual bool ProvidesChannel(const cChannel *channelP, int priorityP = -1, bool *needsDetachReceiversP = NULL) const;
|
||||
virtual bool ProvidesEIT(void) const;
|
||||
virtual int NumProvidedSystems(void) const;
|
||||
virtual const cChannel *GetCurrentlyTunedTransponder(void) const;
|
||||
virtual bool IsTunedToTransponder(const cChannel *channelP) const;
|
||||
protected:
|
||||
virtual bool SetChannelDevice(const cChannel *channelP, bool liveViewP);
|
||||
|
||||
|
||||
2
iptv.c
2
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 {
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
# VDR plugin language source file.
|
||||
# Copyright (C) 2007 Rolf Ahrenberg & Antti Seppala
|
||||
# Copyright (C) 2007-2014 Rolf Ahrenberg & Antti Seppala
|
||||
# This file is distributed under the same license as the iptv package.
|
||||
# Tobias <vdr@e-tobi.net>, 2007.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: vdr-iptv 2.0.0\n"
|
||||
"Project-Id-Version: vdr-iptv 2.0.1\n"
|
||||
"Report-Msgid-Bugs-To: <see README>\n"
|
||||
"POT-Creation-Date: 2013-04-01 04:01+0200\n"
|
||||
"PO-Revision-Date: 2013-04-01 04:01+0200\n"
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
# VDR plugin language source file.
|
||||
# Copyright (C) 2007 Rolf Ahrenberg & Antti Seppala
|
||||
# Copyright (C) 2007-2014 Rolf Ahrenberg & Antti Seppala
|
||||
# This file is distributed under the same license as the iptv package.
|
||||
# Rolf Ahrenberg
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: vdr-iptv 2.0.0\n"
|
||||
"Project-Id-Version: vdr-iptv 2.0.1\n"
|
||||
"Report-Msgid-Bugs-To: <see README>\n"
|
||||
"POT-Creation-Date: 2013-04-01 04:01+0200\n"
|
||||
"PO-Revision-Date: 2013-04-01 04:01+0200\n"
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
# French translations for iptv package.
|
||||
# Copyright (C) 2007 Rolf Ahrenberg & Antti Seppala
|
||||
# Copyright (C) 2007-2014 Rolf Ahrenberg & Antti Seppala
|
||||
# This file is distributed under the same license as the iptv package.
|
||||
# Bruno ROUSSEL <bruno.roussel@free.fr>, 2007.
|
||||
# NIVAL Michaël <mnival@club-internet.fr>, 2008.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: vdr-iptv 2.0.0\n"
|
||||
"Project-Id-Version: vdr-iptv 2.0.1\n"
|
||||
"Report-Msgid-Bugs-To: <see README>\n"
|
||||
"POT-Creation-Date: 2013-04-01 04:01+0200\n"
|
||||
"PO-Revision-Date: 2013-04-01 04:01+0200\n"
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
# VDR plugin language source file.
|
||||
# Copyright (C) 2007 Rolf Ahrenberg & Antti Seppala
|
||||
# Copyright (C) 2007-2014 Rolf Ahrenberg & Antti Seppala
|
||||
# This file is distributed under the same license as the iptv package.
|
||||
# Diego Pierotto <vdr-italian@tiscali.it>, 2008.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: vdr-iptv 2.0.0\n"
|
||||
"Project-Id-Version: vdr-iptv 2.0.1\n"
|
||||
"Report-Msgid-Bugs-To: <see README>\n"
|
||||
"POT-Creation-Date: 2013-04-01 04:01+0200\n"
|
||||
"PO-Revision-Date: 2013-04-01 04:01+0200\n"
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
# VDR plugin language source file.
|
||||
# Copyright (C) 2007 Rolf Ahrenberg & Antti Seppala
|
||||
# Copyright (C) 2007-2014 Rolf Ahrenberg & Antti Seppala
|
||||
# This file is distributed under the same license as the iptv package.
|
||||
# Carel, 2010.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: vdr-iptv 2.0.0\n"
|
||||
"Project-Id-Version: vdr-iptv 2.0.1\n"
|
||||
"Report-Msgid-Bugs-To: <see README>\n"
|
||||
"POT-Creation-Date: 2013-04-01 04:01+0200\n"
|
||||
"PO-Revision-Date: 2013-04-01 04:01+0200\n"
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
# VDR plugin language source file.
|
||||
# Copyright (C) 2007 Rolf Ahrenberg & Antti Seppala
|
||||
# Copyright (C) 2007-2014 Rolf Ahrenberg & Antti Seppala
|
||||
# This file is distributed under the same license as the iptv package.
|
||||
# Alexander Gross <Bikalexander@gmail.com>, 2008.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: vdr-iptv 2.0.0\n"
|
||||
"Project-Id-Version: vdr-iptv 2.0.1\n"
|
||||
"Report-Msgid-Bugs-To: <see README>\n"
|
||||
"POT-Creation-Date: 2013-04-01 04:01+0200\n"
|
||||
"PO-Revision-Date: 2013-04-01 04:01+0200\n"
|
||||
|
||||
@@ -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()
|
||||
@@ -73,7 +73,7 @@ size_t cIptvProtocolCurl::WriteRtspCallback(void *ptrP, size_t sizeP, size_t nme
|
||||
//debug("cIptvProtocolCurl::%s(%zu)", __FUNCTION__, len);
|
||||
|
||||
// Validate packet header ('$') and channel (0)
|
||||
if (obj && (p[0] == 0x24 ) && (p[1] == 0)) {
|
||||
if (obj && (p[0] == 0x24) && (p[1] == 0)) {
|
||||
int length = (p[2] << 8) | p[3];
|
||||
if (length > 3) {
|
||||
// Skip interleave header
|
||||
@@ -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;
|
||||
|
||||
@@ -242,6 +242,8 @@ cIptvSectionFilterHandler::~cIptvSectionFilterHandler()
|
||||
if (Running())
|
||||
Cancel(3);
|
||||
|
||||
DELETE_POINTER(ringBufferM);
|
||||
|
||||
// Destroy all filters
|
||||
cMutexLock MutexLock(&mutexM);
|
||||
for (int i = 0; i < eMaxSecFilterCount; ++i)
|
||||
|
||||
14
sidscanner.c
14
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)) {
|
||||
|
||||
5
source.c
5
source.c
@@ -58,6 +58,7 @@ bool cIptvTransponderParameters::Parse(const char *strP)
|
||||
if (strP && *strP) {
|
||||
const char *delim = "|";
|
||||
char *str = strdup(strP);
|
||||
char *p = str;
|
||||
char *saveptr = NULL;
|
||||
char *token = NULL;
|
||||
bool found_s = false;
|
||||
@@ -120,9 +121,9 @@ bool cIptvTransponderParameters::Parse(const char *strP)
|
||||
if (found_s && found_p && found_f && found_u && found_a)
|
||||
result = true;
|
||||
else
|
||||
error("Invalid channel parameters: %s", str);
|
||||
error("Invalid channel parameters: %s", p);
|
||||
|
||||
free(str);
|
||||
free(p);
|
||||
}
|
||||
|
||||
return (result);
|
||||
|
||||
Reference in New Issue
Block a user