1
0
mirror of https://github.com/rofafor/vdr-plugin-iptv.git synced 2023-10-10 11:37:03 +00:00

Compare commits

...

15 Commits

Author SHA1 Message Date
Rolf Ahrenberg
dc64c044a1 Fixed installation target bugs (Thanks to Alexander Grothe). 2014-03-09 16:08:44 +02:00
Rolf Ahrenberg
3dcbff0a71 Updated translation files and version number. 2014-01-19 00:20:08 +02:00
Rolf Ahrenberg
5aefd40d65 Updated translation files and HISTORY. 2014-01-14 18:42:06 +02:00
Rolf Ahrenberg
6b0337d078 Added initial support for cDevice::MaySwitchTransponder(). 2014-01-14 18:40:54 +02:00
Rolf Ahrenberg
9e6d784aec Shutdown devices already in cPluginManager::Stop(). 2014-01-14 18:30:14 +02:00
Rolf Ahrenberg
3f3ba2ad1a Fixed a typo. 2014-01-11 00:35:12 +02:00
Rolf Ahrenberg
a4b9570ae6 Updated copyright headers. 2014-01-11 00:24:31 +02:00
Rolf Ahrenberg
767b1bdac7 Added support for cDevice::GetCurrentlyTunedTransponder(). 2014-01-10 23:59:26 +02:00
Rolf Ahrenberg
6f648401a4 Updated translation files and HISTORY. 2014-01-10 23:22:15 +02:00
Rolf Ahrenberg
b0995c9a9e Added support for cDevice::IsTunedToTransponder(). 2014-01-07 22:24:39 +02:00
Rolf Ahrenberg
412af81271 Fixed a mem leak and re-ordered pointer deletions. 2014-01-07 17:55:13 +02:00
Rolf Ahrenberg
43326bb4ea Whitespace cleanup. 2014-01-07 17:55:08 +02:00
Rolf Ahrenberg
555c08bd4d Updated Makefile. 2014-01-06 22:01:55 +02:00
Rolf Ahrenberg
5ad3103626 Fixed scan-build issues. 2014-01-02 21:47:43 +02:00
Rolf Ahrenberg
a4f0bdf737 Added missing CURL timeouts and improved section id scanner. 2014-01-02 21:35:38 +02:00
23 changed files with 163 additions and 66 deletions

17
HISTORY
View File

@@ -212,3 +212,20 @@ VDR Plugin 'iptv' Revision History
- Fixed a nasty network byte order bug. - Fixed a nasty network byte order bug.
- Fixed and refactored the section filtering code. - Fixed and refactored the section filtering code.
- Fixed a possible crash in the file protocol. - 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.
2014-01-18: Version 2.0.2
- Made devices to shutdown already in cPluginManager::Stop()
to prevent possible crashes while VDR shutdown.
2014-03-09: Version 2.0.3
- Fixed installation target bugs (Thanks to Alexander Grothe).

View File

@@ -28,10 +28,11 @@ GITTAG = $(shell git describe --always 2>/dev/null)
### The directory environment: ### The directory environment:
# Use package data if installed...otherwise assume we're under the VDR source directory: # 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) LIBDIR = $(call PKGCFG,libdir)
LOCDIR = $(call PKGCFG,locdir) LOCDIR = $(call PKGCFG,locdir)
PLGCFG = $(call PKGCFG,plgcfg) PLGCFG = $(call PKGCFG,plgcfg)
RESDIR = $(call PKGCFG,resdir)
CFGDIR = $(call PKGCFG,configdir) CFGDIR = $(call PKGCFG,configdir)
# #
TMPDIR ?= /tmp TMPDIR ?= /tmp
@@ -147,7 +148,8 @@ install-lib: $(SOFILE)
install-conf: install-conf:
@mkdir -p $(DESTDIR)$(CFGDIR)/plugins/$(PLUGIN) @mkdir -p $(DESTDIR)$(CFGDIR)/plugins/$(PLUGIN)
@cp -pn $(PLUGIN)/* $(DESTDIR)$(CFGDIR)/plugins/$(PLUGIN)/ @mkdir -p $(DESTDIR)$(RESDIR)/plugins/$(PLUGIN)
@cp -pn $(PLUGIN)/* $(DESTDIR)$(RESDIR)/plugins/$(PLUGIN)/
install: install-lib install-i18n install-conf install: install-lib install-i18n install-conf

10
README
View File

@@ -165,8 +165,7 @@ Notes:
"disable_ca_updates" patch to the VDR in order to get rid of "Channel not "disable_ca_updates" patch to the VDR in order to get rid of "Channel not
available" messages. available" messages.
- EIT scanning functionality can be disabled for all IPTV channels by applying - EIT scanning functionality is disabled by default.
the "disable_eitscan" patch to the VDR.
- Section id and pid scanners should be disabled after the correct data is - Section id and pid scanners should be disabled after the correct data is
found. This can be made via VDR's channel editor. found. This can be made via VDR's channel editor.
@@ -180,7 +179,12 @@ Notes:
netrc configuration file for authentication: netrc configuration file for authentication:
$(CONFDIR)/iptv/netrc $(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: Acknowledgements:
- The IPTV section filtering code is derived from Linux kernel. - The IPTV section filtering code is derived from Linux kernel.

View File

@@ -44,7 +44,8 @@
do { \ do { \
if (exp) { \ if (exp) { \
char tmp[64]; \ 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; \ func; \
ret; \ ret; \
} \ } \

View File

@@ -19,6 +19,7 @@ cIptvConfig::cIptvConfig(void)
for (unsigned int i = 0; i < ARRAY_SIZE(disabledFiltersM); ++i) for (unsigned int i = 0; i < ARRAY_SIZE(disabledFiltersM); ++i)
disabledFiltersM[i] = -1; disabledFiltersM[i] = -1;
memset(configDirectoryM, 0, sizeof(configDirectoryM)); memset(configDirectoryM, 0, sizeof(configDirectoryM));
memset(resourceDirectoryM, 0, sizeof(resourceDirectoryM));
} }
unsigned int cIptvConfig::GetDisabledFiltersCount(void) const unsigned int cIptvConfig::GetDisabledFiltersCount(void) const
@@ -45,3 +46,9 @@ void cIptvConfig::SetConfigDirectory(const char *directoryP)
debug("cIptvConfig::%s(%s)", __FUNCTION__, directoryP); debug("cIptvConfig::%s(%s)", __FUNCTION__, directoryP);
ERROR_IF(!realpath(directoryP, configDirectoryM), "Cannot canonicalize configuration directory"); ERROR_IF(!realpath(directoryP, configDirectoryM), "Cannot canonicalize configuration directory");
} }
void cIptvConfig::SetResourceDirectory(const char *directoryP)
{
debug("cIptvConfig::%s(%s)", __FUNCTION__, directoryP);
ERROR_IF(!realpath(directoryP, resourceDirectoryM), "Cannot canonicalize resource directory");
}

View File

@@ -21,6 +21,7 @@ private:
unsigned int sectionFilteringM; unsigned int sectionFilteringM;
int disabledFiltersM[SECTION_FILTER_TABLE_SIZE]; int disabledFiltersM[SECTION_FILTER_TABLE_SIZE];
char configDirectoryM[PATH_MAX]; char configDirectoryM[PATH_MAX];
char resourceDirectoryM[PATH_MAX];
public: public:
cIptvConfig(); cIptvConfig();
@@ -30,6 +31,7 @@ public:
unsigned int GetUseBytes(void) const { return useBytesM; } unsigned int GetUseBytes(void) const { return useBytesM; }
unsigned int GetSectionFiltering(void) const { return sectionFilteringM; } unsigned int GetSectionFiltering(void) const { return sectionFilteringM; }
const char *GetConfigDirectory(void) const { return configDirectoryM; } const char *GetConfigDirectory(void) const { return configDirectoryM; }
const char *GetResourceDirectory(void) const { return resourceDirectoryM; }
unsigned int GetDisabledFiltersCount(void) const; unsigned int GetDisabledFiltersCount(void) const;
int GetDisabledFilters(unsigned int indexP) const; int GetDisabledFilters(unsigned int indexP) const;
void SetTsBufferSize(unsigned int sizeP) { tsBufferSizeM = sizeP; } void SetTsBufferSize(unsigned int sizeP) { tsBufferSizeM = sizeP; }
@@ -39,6 +41,7 @@ public:
void SetSectionFiltering(unsigned int onOffP) { sectionFilteringM = onOffP; } void SetSectionFiltering(unsigned int onOffP) { sectionFilteringM = onOffP; }
void SetDisabledFilters(unsigned int indexP, int numberP); void SetDisabledFilters(unsigned int indexP, int numberP);
void SetConfigDirectory(const char *directoryP); void SetConfigDirectory(const char *directoryP);
void SetResourceDirectory(const char *directoryP);
}; };
extern cIptvConfig IptvConfig; extern cIptvConfig IptvConfig;

View File

@@ -20,7 +20,7 @@ cIptvDevice::cIptvDevice(unsigned int indexP)
isOpenDvrM(false), isOpenDvrM(false),
sidScanEnabledM(false), sidScanEnabledM(false),
pidScanEnabledM(false), pidScanEnabledM(false),
channelIdM(tChannelID::InvalidID) channelM()
{ {
unsigned int bufsize = (unsigned int)MEGABYTE(IptvConfig.GetTsBufferSize()); unsigned int bufsize = (unsigned int)MEGABYTE(IptvConfig.GetTsBufferSize());
bufsize -= (bufsize % TS_SIZE); bufsize -= (bufsize % TS_SIZE);
@@ -58,18 +58,18 @@ cIptvDevice::cIptvDevice(unsigned int indexP)
cIptvDevice::~cIptvDevice() cIptvDevice::~cIptvDevice()
{ {
debug("cIptvDevice::%s(%d)", __FUNCTION__, deviceIndexM); 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 // Stop section handler of iptv device
StopSectionHandler(); StopSectionHandler();
DELETE_POINTER(pIptvSectionM); 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 // Close dvr fifo
if (dvrFdM >= 0) { if (dvrFdM >= 0) {
int fd = dvrFdM; int fd = dvrFdM;
@@ -91,6 +91,15 @@ bool cIptvDevice::Initialize(unsigned int deviceCountP)
return true; return true;
} }
void cIptvDevice::Shutdown(void)
{
debug("cIptvDevice::%s()", __FUNCTION__);
for (int i = 0; i < IPTV_MAX_DEVICES; ++i) {
if (IptvDevicesS[i])
IptvDevicesS[i]->CloseDvr();
}
}
unsigned int cIptvDevice::Count(void) unsigned int cIptvDevice::Count(void)
{ {
unsigned int count = 0; unsigned int count = 0;
@@ -106,7 +115,7 @@ cIptvDevice *cIptvDevice::GetIptvDevice(int cardIndexP)
{ {
//debug("cIptvDevice::%s(%d)", __FUNCTION__, cardIndexP); //debug("cIptvDevice::%s(%d)", __FUNCTION__, cardIndexP);
for (unsigned int i = 0; i < IPTV_MAX_DEVICES; ++i) { for (unsigned int i = 0; i < IPTV_MAX_DEVICES; ++i) {
if ((IptvDevicesS[i] != NULL) && (IptvDevicesS[i]->CardIndex() == cardIndexP)) { if (IptvDevicesS[i] && (IptvDevicesS[i]->CardIndex() == cardIndexP)) {
//debug("cIptvDevice::%s(%d): found!", __FUNCTION__, cardIndexP); //debug("cIptvDevice::%s(%d): found!", __FUNCTION__, cardIndexP);
return IptvDevicesS[i]; return IptvDevicesS[i];
} }
@@ -214,7 +223,7 @@ bool cIptvDevice::ProvidesChannel(const cChannel *channelP, int priorityP, bool
if (channelP && ProvidesTransponder(channelP)) { if (channelP && ProvidesTransponder(channelP)) {
result = hasPriority; result = hasPriority;
if (Receiving()) { if (Receiving()) {
if (channelP->GetChannelID() == channelIdM) if (channelP->GetChannelID() == channelM.GetChannelID())
result = true; result = true;
else else
needsDetachReceivers = Receiving(); needsDetachReceivers = Receiving();
@@ -235,6 +244,21 @@ int cIptvDevice::NumProvidedSystems(void) const
return 1; 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::MaySwitchTransponder(const cChannel *channelP) const
{
return cDevice::MaySwitchTransponder(channelP);
}
bool cIptvDevice::SetChannelDevice(const cChannel *channelP, bool liveViewP) bool cIptvDevice::SetChannelDevice(const cChannel *channelP, bool liveViewP)
{ {
cIptvProtocolIf *protocol; cIptvProtocolIf *protocol;
@@ -270,11 +294,11 @@ bool cIptvDevice::SetChannelDevice(const cChannel *channelP, bool liveViewP)
sidScanEnabledM = itp.SidScan() ? true : false; sidScanEnabledM = itp.SidScan() ? true : false;
pidScanEnabledM = itp.PidScan() ? true : false; pidScanEnabledM = itp.PidScan() ? true : false;
if (pIptvStreamerM->Set(itp.Address(), itp.Parameter(), deviceIndexM, protocol)) { if (pIptvStreamerM->Set(itp.Address(), itp.Parameter(), deviceIndexM, protocol)) {
channelIdM = channelP->GetChannelID(); channelM = *channelP;
if (sidScanEnabledM && pSidScannerM && IptvConfig.GetSectionFiltering()) if (sidScanEnabledM && pSidScannerM && IptvConfig.GetSectionFiltering())
pSidScannerM->SetChannel(channelIdM); pSidScannerM->SetChannel(channelM.GetChannelID());
if (pidScanEnabledM && pPidScannerM) if (pidScanEnabledM && pPidScannerM)
pPidScannerM->SetChannel(channelIdM); pPidScannerM->SetChannel(channelM.GetChannelID());
} }
return true; return true;
} }
@@ -310,6 +334,8 @@ bool cIptvDevice::OpenDvr(void)
pIptvStreamerM->Open(); pIptvStreamerM->Open();
if (sidScanEnabledM && pSidScannerM && IptvConfig.GetSectionFiltering()) if (sidScanEnabledM && pSidScannerM && IptvConfig.GetSectionFiltering())
pSidScannerM->Open(); pSidScannerM->Open();
if (pidScanEnabledM && pPidScannerM)
pPidScannerM->Open();
isOpenDvrM = true; isOpenDvrM = true;
return true; return true;
} }
@@ -317,6 +343,8 @@ bool cIptvDevice::OpenDvr(void)
void cIptvDevice::CloseDvr(void) void cIptvDevice::CloseDvr(void)
{ {
debug("cIptvDevice::%s(%d)", __FUNCTION__, deviceIndexM); debug("cIptvDevice::%s(%d)", __FUNCTION__, deviceIndexM);
if (pidScanEnabledM && pPidScannerM)
pPidScannerM->Close();
if (sidScanEnabledM && pSidScannerM) if (sidScanEnabledM && pSidScannerM)
pSidScannerM->Close(); pSidScannerM->Close();
if (pIptvStreamerM) if (pIptvStreamerM)
@@ -384,7 +412,7 @@ unsigned int cIptvDevice::CheckData(void)
bool cIptvDevice::GetTSPacket(uchar *&Data) bool cIptvDevice::GetTSPacket(uchar *&Data)
{ {
//debug("cIptvDevice::%s(%d)", __FUNCTION__, deviceIndexM); //debug("cIptvDevice::%s(%d)", __FUNCTION__, deviceIndexM);
if (tsBufferM && !IsBuffering()) { if (isOpenDvrM && tsBufferM && !IsBuffering()) {
if (isPacketDeliveredM) { if (isPacketDeliveredM) {
tsBufferM->Del(TS_SIZE); tsBufferM->Del(TS_SIZE);
isPacketDeliveredM = false; isPacketDeliveredM = false;

View File

@@ -27,6 +27,7 @@ class cIptvDevice : public cDevice, public cIptvPidStatistics, public cIptvBuffe
public: public:
static unsigned int deviceCount; static unsigned int deviceCount;
static bool Initialize(unsigned int DeviceCount); static bool Initialize(unsigned int DeviceCount);
static void Shutdown(void);
static unsigned int Count(void); static unsigned int Count(void);
static cIptvDevice *GetIptvDevice(int CardIndex); static cIptvDevice *GetIptvDevice(int CardIndex);
@@ -40,7 +41,7 @@ private:
bool pidScanEnabledM; bool pidScanEnabledM;
cRingBufferLinear *tsBufferM; cRingBufferLinear *tsBufferM;
mutable int tsBufferPrefillM; mutable int tsBufferPrefillM;
tChannelID channelIdM; cChannel channelM;
cIptvProtocolUdp *pUdpProtocolM; cIptvProtocolUdp *pUdpProtocolM;
cIptvProtocolCurl *pCurlProtocolM; cIptvProtocolCurl *pCurlProtocolM;
cIptvProtocolHttp *pHttpProtocolM; cIptvProtocolHttp *pHttpProtocolM;
@@ -87,6 +88,10 @@ public:
virtual bool ProvidesChannel(const cChannel *channelP, int priorityP = -1, bool *needsDetachReceiversP = NULL) const; virtual bool ProvidesChannel(const cChannel *channelP, int priorityP = -1, bool *needsDetachReceiversP = NULL) const;
virtual bool ProvidesEIT(void) const; virtual bool ProvidesEIT(void) const;
virtual int NumProvidedSystems(void) const; virtual int NumProvidedSystems(void) const;
virtual const cChannel *GetCurrentlyTunedTransponder(void) const;
virtual bool IsTunedToTransponder(const cChannel *channelP) const;
virtual bool MaySwitchTransponder(const cChannel *channelP) const;
protected: protected:
virtual bool SetChannelDevice(const cChannel *channelP, bool liveViewP); virtual bool SetChannelDevice(const cChannel *channelP, bool liveViewP);

6
iptv.c
View File

@@ -21,7 +21,7 @@
#define GITVERSION "" #define GITVERSION ""
#endif #endif
const char VERSION[] = "2.0.0" GITVERSION; const char VERSION[] = "2.0.3" GITVERSION;
static const char DESCRIPTION[] = trNOOP("Experience the IPTV"); static const char DESCRIPTION[] = trNOOP("Experience the IPTV");
class cPluginIptv : public cPlugin { class cPluginIptv : public cPlugin {
@@ -99,7 +99,8 @@ bool cPluginIptv::Initialize(void)
{ {
debug("cPluginIptv::%s()", __FUNCTION__); debug("cPluginIptv::%s()", __FUNCTION__);
// Initialize any background activities the plugin shall perform. // Initialize any background activities the plugin shall perform.
IptvConfig.SetConfigDirectory(cPlugin::ResourceDirectory(PLUGIN_NAME_I18N)); IptvConfig.SetConfigDirectory(cPlugin::ConfigDirectory(PLUGIN_NAME_I18N));
IptvConfig.SetResourceDirectory(cPlugin::ResourceDirectory(PLUGIN_NAME_I18N));
return cIptvDevice::Initialize(deviceCountM); return cIptvDevice::Initialize(deviceCountM);
} }
@@ -118,6 +119,7 @@ void cPluginIptv::Stop(void)
{ {
debug("cPluginIptv::%s()", __FUNCTION__); debug("cPluginIptv::%s()", __FUNCTION__);
// Stop any background activities the plugin is performing. // Stop any background activities the plugin is performing.
cIptvDevice::Shutdown();
curl_global_cleanup(); curl_global_cleanup();
} }

View File

@@ -39,7 +39,6 @@ void cPidScanner::SetChannel(const tChannelID &channelIdP)
aPidM = 0xFFFF; aPidM = 0xFFFF;
numApidsM = 0; numApidsM = 0;
processM = true; processM = true;
timeoutM.Set(PIDSCANNER_TIMEOUT_IN_MS);
} }
void cPidScanner::Process(const uint8_t* bufP) void cPidScanner::Process(const uint8_t* bufP)

View File

@@ -13,6 +13,12 @@
class cPidScanner { class cPidScanner {
private: private:
enum {
PIDSCANNER_APID_COUNT = 5, /* minimum count of audio pid samples for pid detection */
PIDSCANNER_VPID_COUNT = 5, /* minimum count of video pid samples for pid detection */
PIDSCANNER_PID_DELTA_COUNT = 100, /* minimum count of pid samples for audio/video only pid detection */
PIDSCANNER_TIMEOUT_IN_MS = 15000 /* 15s timeout for detection */
};
cTimeMs timeoutM; cTimeMs timeoutM;
tChannelID channelIdM; tChannelID channelIdM;
bool processM; bool processM;
@@ -26,6 +32,8 @@ public:
~cPidScanner(); ~cPidScanner();
void SetChannel(const tChannelID &channelIdP); void SetChannel(const tChannelID &channelIdP);
void Process(const uint8_t* bufP); void Process(const uint8_t* bufP);
void Open() { debug("cPidScanner::%s()", __FUNCTION__); timeoutM.Set(PIDSCANNER_TIMEOUT_IN_MS); }
void Close() { debug("cPidScanner::%s()", __FUNCTION__); timeoutM.Set(0); }
}; };
#endif // __PIDSCANNER_H #endif // __PIDSCANNER_H

View File

@@ -1,14 +1,14 @@
# VDR plugin language source file. # 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. # This file is distributed under the same license as the iptv package.
# Tobias <vdr@e-tobi.net>, 2007. # Tobias <vdr@e-tobi.net>, 2007.
# #
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: vdr-iptv 2.0.0\n" "Project-Id-Version: vdr-iptv 2.0.3\n"
"Report-Msgid-Bugs-To: <see README>\n" "Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2013-04-01 04:01+0200\n" "POT-Creation-Date: 2014-03-09 03:09+0200\n"
"PO-Revision-Date: 2013-04-01 04:01+0200\n" "PO-Revision-Date: 2014-03-09 03:09+0200\n"
"Last-Translator: Tobias Grimm <tg@e-tobi.net>\n" "Last-Translator: Tobias Grimm <tg@e-tobi.net>\n"
"Language-Team: German <vdr@linuxtv.org>\n" "Language-Team: German <vdr@linuxtv.org>\n"
"Language: de\n" "Language: de\n"

View File

@@ -1,14 +1,14 @@
# VDR plugin language source file. # 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. # This file is distributed under the same license as the iptv package.
# Rolf Ahrenberg # Rolf Ahrenberg
# #
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: vdr-iptv 2.0.0\n" "Project-Id-Version: vdr-iptv 2.0.3\n"
"Report-Msgid-Bugs-To: <see README>\n" "Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2013-04-01 04:01+0200\n" "POT-Creation-Date: 2014-03-09 03:09+0200\n"
"PO-Revision-Date: 2013-04-01 04:01+0200\n" "PO-Revision-Date: 2014-03-09 03:09+0200\n"
"Last-Translator: Rolf Ahrenberg\n" "Last-Translator: Rolf Ahrenberg\n"
"Language-Team: Finnish <vdr@linuxtv.org>\n" "Language-Team: Finnish <vdr@linuxtv.org>\n"
"Language: fi\n" "Language: fi\n"

View File

@@ -1,15 +1,15 @@
# French translations for iptv package. # 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. # This file is distributed under the same license as the iptv package.
# Bruno ROUSSEL <bruno.roussel@free.fr>, 2007. # Bruno ROUSSEL <bruno.roussel@free.fr>, 2007.
# NIVAL Michaël <mnival@club-internet.fr>, 2008. # NIVAL Michaël <mnival@club-internet.fr>, 2008.
# #
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: vdr-iptv 2.0.0\n" "Project-Id-Version: vdr-iptv 2.0.3\n"
"Report-Msgid-Bugs-To: <see README>\n" "Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2013-04-01 04:01+0200\n" "POT-Creation-Date: 2014-03-09 03:09+0200\n"
"PO-Revision-Date: 2013-04-01 04:01+0200\n" "PO-Revision-Date: 2014-03-09 03:09+0200\n"
"Last-Translator: NIVAL Michaël <mnival@club-internet.fr>\n" "Last-Translator: NIVAL Michaël <mnival@club-internet.fr>\n"
"Language-Team: French <vdr@linuxtv.org>\n" "Language-Team: French <vdr@linuxtv.org>\n"
"Language: fr\n" "Language: fr\n"

View File

@@ -1,14 +1,14 @@
# VDR plugin language source file. # 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. # This file is distributed under the same license as the iptv package.
# Diego Pierotto <vdr-italian@tiscali.it>, 2008. # Diego Pierotto <vdr-italian@tiscali.it>, 2008.
# #
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: vdr-iptv 2.0.0\n" "Project-Id-Version: vdr-iptv 2.0.3\n"
"Report-Msgid-Bugs-To: <see README>\n" "Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2013-04-01 04:01+0200\n" "POT-Creation-Date: 2014-03-09 03:09+0200\n"
"PO-Revision-Date: 2013-04-01 04:01+0200\n" "PO-Revision-Date: 2014-03-09 03:09+0200\n"
"Last-Translator: Diego Pierotto <vdr-italian@tiscali.it>\n" "Last-Translator: Diego Pierotto <vdr-italian@tiscali.it>\n"
"Language-Team: Italian <vdr@linuxtv.org>\n" "Language-Team: Italian <vdr@linuxtv.org>\n"
"Language: it\n" "Language: it\n"

View File

@@ -1,14 +1,14 @@
# VDR plugin language source file. # 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. # This file is distributed under the same license as the iptv package.
# Carel, 2010. # Carel, 2010.
# #
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: vdr-iptv 2.0.0\n" "Project-Id-Version: vdr-iptv 2.0.3\n"
"Report-Msgid-Bugs-To: <see README>\n" "Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2013-04-01 04:01+0200\n" "POT-Creation-Date: 2014-03-09 03:09+0200\n"
"PO-Revision-Date: 2013-04-01 04:01+0200\n" "PO-Revision-Date: 2014-03-09 03:09+0200\n"
"Last-Translator: Carel\n" "Last-Translator: Carel\n"
"Language-Team: Dutch <vdr@linuxtv.org>\n" "Language-Team: Dutch <vdr@linuxtv.org>\n"
"Language: nl\n" "Language: nl\n"

View File

@@ -1,14 +1,14 @@
# VDR plugin language source file. # 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. # This file is distributed under the same license as the iptv package.
# Alexander Gross <Bikalexander@gmail.com>, 2008. # Alexander Gross <Bikalexander@gmail.com>, 2008.
# #
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: vdr-iptv 2.0.0\n" "Project-Id-Version: vdr-iptv 2.0.3\n"
"Report-Msgid-Bugs-To: <see README>\n" "Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2013-04-01 04:01+0200\n" "POT-Creation-Date: 2014-03-09 03:09+0200\n"
"PO-Revision-Date: 2013-04-01 04:01+0200\n" "PO-Revision-Date: 2014-03-09 03:09+0200\n"
"Last-Translator: Alexander Gross <Bikalexander@gmail.com>\n" "Last-Translator: Alexander Gross <Bikalexander@gmail.com>\n"
"Language-Team: Russian <vdr@linuxtv.org>\n" "Language-Team: Russian <vdr@linuxtv.org>\n"
"Language: ru\n" "Language: ru\n"

View File

@@ -15,12 +15,12 @@
#define iptv_curl_easy_setopt(X, Y, Z) \ #define iptv_curl_easy_setopt(X, Y, Z) \
if ((res = curl_easy_setopt((X), (Y), (Z))) != CURLE_OK) { \ 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) \ #define iptv_curl_easy_perform(X) \
if ((res = curl_easy_perform((X))) != CURLE_OK) { \ 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() 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, (long)CURL_NETRC_OPTIONAL);
iptv_curl_easy_setopt(handleM, CURLOPT_NETRC_FILE, *netrc); 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); iptv_curl_easy_setopt(handleM, CURLOPT_CONNECTTIMEOUT, (long)eConnectTimeoutS);
// Set user-agent // Set user-agent
@@ -345,6 +346,10 @@ bool cIptvProtocolCurl::Connect()
break; break;
case eModeFile: case eModeFile:
// Set timeout
iptv_curl_easy_setopt(handleM, CURLOPT_TIMEOUT_MS, 10L);
break;
case eModeUnknown: case eModeUnknown:
default: default:
break; break;

View File

@@ -158,7 +158,7 @@ bool cIptvProtocolExt::Set(const char* locationP, const int parameterP, const in
if (!isempty(locationP)) { if (!isempty(locationP)) {
struct stat stbuf; struct stat stbuf;
// Update script file and parameter // Update script file and parameter
scriptFileM = cString::sprintf("%s/%s", IptvConfig.GetConfigDirectory(), locationP); scriptFileM = cString::sprintf("%s/%s", IptvConfig.GetResourceDirectory(), locationP);
if ((stat(*scriptFileM, &stbuf) != 0) || (strstr(*scriptFileM, "..") != 0)) { if ((stat(*scriptFileM, &stbuf) != 0) || (strstr(*scriptFileM, "..") != 0)) {
error("Non-existent or relative path script '%s'", *scriptFileM); error("Non-existent or relative path script '%s'", *scriptFileM);
return false; return false;

View File

@@ -238,9 +238,9 @@ cIptvSectionFilterHandler::cIptvSectionFilterHandler(int deviceIndexP, unsigned
cIptvSectionFilterHandler::~cIptvSectionFilterHandler() cIptvSectionFilterHandler::~cIptvSectionFilterHandler()
{ {
debug("cIptvSectionFilterHandler::%s(%d)", __FUNCTION__, deviceIndexM); debug("cIptvSectionFilterHandler::%s(%d)", __FUNCTION__, deviceIndexM);
// Stop thread Stop();
if (Running())
Cancel(3); DELETE_POINTER(ringBufferM);
// Destroy all filters // Destroy all filters
cMutexLock MutexLock(&mutexM); cMutexLock MutexLock(&mutexM);
@@ -248,6 +248,15 @@ cIptvSectionFilterHandler::~cIptvSectionFilterHandler()
Delete(i); Delete(i);
} }
bool cIptvSectionFilterHandler::Stop(void)
{
debug("cIptvSectionFilterHandler::%s(%d): entering", __FUNCTION__, deviceIndexM);
// Stop thread
if (Running())
Cancel(3);
return true;
}
void cIptvSectionFilterHandler::Action(void) void cIptvSectionFilterHandler::Action(void)
{ {
debug("cIptvSectionFilterHandler::%s(%d): entering", __FUNCTION__, deviceIndexM); debug("cIptvSectionFilterHandler::%s(%d): entering", __FUNCTION__, deviceIndexM);
@@ -381,4 +390,3 @@ void cIptvSectionFilterHandler::Write(uchar *bufferP, int lengthP)
ringBufferM->ReportOverflow(lengthP - len); ringBufferM->ReportOverflow(lengthP - len);
} }
} }

View File

@@ -80,6 +80,7 @@ protected:
public: public:
cIptvSectionFilterHandler(int deviceIndexP, unsigned int bufferLenP); cIptvSectionFilterHandler(int deviceIndexP, unsigned int bufferLenP);
virtual ~cIptvSectionFilterHandler(); virtual ~cIptvSectionFilterHandler();
bool Stop(void);
cString GetInformation(void); cString GetInformation(void);
int Open(u_short pidP, u_char tidP, u_char maskP); int Open(u_short pidP, u_char tidP, u_char maskP);
void Close(int handleP); void Close(int handleP);

View File

@@ -71,17 +71,23 @@ void cSidScanner::Process(u_short pidP, u_char tidP, const u_char *dataP, int le
if (ts.getTransportStreamId() != channelIdM.Tid()) { if (ts.getTransportStreamId() != channelIdM.Tid()) {
debug("cSidScanner::%s(): tsid=%d", __FUNCTION__, ts.getTransportStreamId()); debug("cSidScanner::%s(): tsid=%d", __FUNCTION__, ts.getTransportStreamId());
newTid = ts.getTransportStreamId(); newTid = ts.getTransportStreamId();
}
tidFoundM = true; tidFoundM = true;
}
if (ts.getOriginalNetworkId() != channelIdM.Nid()) {
debug("cSidScanner::%s(): onid=%d", __FUNCTION__, ts.getOriginalNetworkId());
newNid = ts.getOriginalNetworkId();
nidFoundM = true;
}
break; // default to the first one break; // default to the first one
} }
if (nit.getNetworkId() != channelIdM.Nid()) { // fallback for network id if not found already
debug("cSidScanner::%s(): nid=%d", __FUNCTION__, ts.getTransportStreamId()); if (!nidFoundM && (nit.getNetworkId() != channelIdM.Nid())) {
debug("cSidScanner::%s(): nid=%d", __FUNCTION__, nit.getNetworkId());
newNid = nit.getNetworkId(); newNid = nit.getNetworkId();
}
nidFoundM = true; nidFoundM = true;
} }
} }
}
if ((newSid >= 0) || (newNid >= 0) || (newTid >= 0)) { if ((newSid >= 0) || (newNid >= 0) || (newTid >= 0)) {
if (!Channels.Lock(true, 10)) if (!Channels.Lock(true, 10))
return; return;

View File

@@ -58,6 +58,7 @@ bool cIptvTransponderParameters::Parse(const char *strP)
if (strP && *strP) { if (strP && *strP) {
const char *delim = "|"; const char *delim = "|";
char *str = strdup(strP); char *str = strdup(strP);
char *p = str;
char *saveptr = NULL; char *saveptr = NULL;
char *token = NULL; char *token = NULL;
bool found_s = false; 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) if (found_s && found_p && found_f && found_u && found_a)
result = true; result = true;
else else
error("Invalid channel parameters: %s", str); error("Invalid channel parameters: %s", p);
free(str); free(p);
} }
return (result); return (result);