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

Compare commits

...

4 Commits

Author SHA1 Message Date
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
14 changed files with 67 additions and 26 deletions

View File

@@ -220,3 +220,8 @@ VDR Plugin 'iptv' Revision History
- 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.

View File

@@ -91,6 +91,15 @@ bool cIptvDevice::Initialize(unsigned int deviceCountP)
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 count = 0;
@@ -106,7 +115,7 @@ cIptvDevice *cIptvDevice::GetIptvDevice(int cardIndexP)
{
//debug("cIptvDevice::%s(%d)", __FUNCTION__, cardIndexP);
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);
return IptvDevicesS[i];
}
@@ -245,6 +254,11 @@ 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)
{
cIptvProtocolIf *protocol;
@@ -320,6 +334,8 @@ bool cIptvDevice::OpenDvr(void)
pIptvStreamerM->Open();
if (sidScanEnabledM && pSidScannerM && IptvConfig.GetSectionFiltering())
pSidScannerM->Open();
if (pidScanEnabledM && pPidScannerM)
pPidScannerM->Open();
isOpenDvrM = true;
return true;
}
@@ -327,6 +343,8 @@ bool cIptvDevice::OpenDvr(void)
void cIptvDevice::CloseDvr(void)
{
debug("cIptvDevice::%s(%d)", __FUNCTION__, deviceIndexM);
if (pidScanEnabledM && pPidScannerM)
pPidScannerM->Close();
if (sidScanEnabledM && pSidScannerM)
pSidScannerM->Close();
if (pIptvStreamerM)
@@ -394,7 +412,7 @@ unsigned int cIptvDevice::CheckData(void)
bool cIptvDevice::GetTSPacket(uchar *&Data)
{
//debug("cIptvDevice::%s(%d)", __FUNCTION__, deviceIndexM);
if (tsBufferM && !IsBuffering()) {
if (isOpenDvrM && tsBufferM && !IsBuffering()) {
if (isPacketDeliveredM) {
tsBufferM->Del(TS_SIZE);
isPacketDeliveredM = false;

View File

@@ -27,6 +27,7 @@ class cIptvDevice : public cDevice, public cIptvPidStatistics, public cIptvBuffe
public:
static unsigned int deviceCount;
static bool Initialize(unsigned int DeviceCount);
static void Shutdown(void);
static unsigned int Count(void);
static cIptvDevice *GetIptvDevice(int CardIndex);
@@ -89,6 +90,8 @@ public:
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:
virtual bool SetChannelDevice(const cChannel *channelP, bool liveViewP);

3
iptv.c
View File

@@ -21,7 +21,7 @@
#define GITVERSION ""
#endif
const char VERSION[] = "2.0.1" GITVERSION;
const char VERSION[] = "2.0.2" GITVERSION;
static const char DESCRIPTION[] = trNOOP("Experience the IPTV");
class cPluginIptv : public cPlugin {
@@ -118,6 +118,7 @@ void cPluginIptv::Stop(void)
{
debug("cPluginIptv::%s()", __FUNCTION__);
// Stop any background activities the plugin is performing.
cIptvDevice::Shutdown();
curl_global_cleanup();
}

View File

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

View File

@@ -13,6 +13,12 @@
class cPidScanner {
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;
tChannelID channelIdM;
bool processM;
@@ -26,6 +32,8 @@ public:
~cPidScanner();
void SetChannel(const tChannelID &channelIdP);
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

View File

@@ -5,10 +5,10 @@
#
msgid ""
msgstr ""
"Project-Id-Version: vdr-iptv 2.0.1\n"
"Project-Id-Version: vdr-iptv 2.0.2\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"
"POT-Creation-Date: 2014-01-08 01:18+0200\n"
"PO-Revision-Date: 2014-01-08 01:18+0200\n"
"Last-Translator: Tobias Grimm <tg@e-tobi.net>\n"
"Language-Team: German <vdr@linuxtv.org>\n"
"Language: de\n"

View File

@@ -5,10 +5,10 @@
#
msgid ""
msgstr ""
"Project-Id-Version: vdr-iptv 2.0.1\n"
"Project-Id-Version: vdr-iptv 2.0.2\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"
"POT-Creation-Date: 2014-01-08 01:18+0200\n"
"PO-Revision-Date: 2014-01-08 01:18+0200\n"
"Last-Translator: Rolf Ahrenberg\n"
"Language-Team: Finnish <vdr@linuxtv.org>\n"
"Language: fi\n"

View File

@@ -6,10 +6,10 @@
#
msgid ""
msgstr ""
"Project-Id-Version: vdr-iptv 2.0.1\n"
"Project-Id-Version: vdr-iptv 2.0.2\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"
"POT-Creation-Date: 2014-01-08 01:18+0200\n"
"PO-Revision-Date: 2014-01-08 01:18+0200\n"
"Last-Translator: NIVAL Michaël <mnival@club-internet.fr>\n"
"Language-Team: French <vdr@linuxtv.org>\n"
"Language: fr\n"

View File

@@ -5,10 +5,10 @@
#
msgid ""
msgstr ""
"Project-Id-Version: vdr-iptv 2.0.1\n"
"Project-Id-Version: vdr-iptv 2.0.2\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"
"POT-Creation-Date: 2014-01-08 01:18+0200\n"
"PO-Revision-Date: 2014-01-08 01:18+0200\n"
"Last-Translator: Diego Pierotto <vdr-italian@tiscali.it>\n"
"Language-Team: Italian <vdr@linuxtv.org>\n"
"Language: it\n"

View File

@@ -5,10 +5,10 @@
#
msgid ""
msgstr ""
"Project-Id-Version: vdr-iptv 2.0.1\n"
"Project-Id-Version: vdr-iptv 2.0.2\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"
"POT-Creation-Date: 2014-01-08 01:18+0200\n"
"PO-Revision-Date: 2014-01-08 01:18+0200\n"
"Last-Translator: Carel\n"
"Language-Team: Dutch <vdr@linuxtv.org>\n"
"Language: nl\n"

View File

@@ -5,10 +5,10 @@
#
msgid ""
msgstr ""
"Project-Id-Version: vdr-iptv 2.0.1\n"
"Project-Id-Version: vdr-iptv 2.0.2\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"
"POT-Creation-Date: 2014-01-08 01:18+0200\n"
"PO-Revision-Date: 2014-01-08 01:18+0200\n"
"Last-Translator: Alexander Gross <Bikalexander@gmail.com>\n"
"Language-Team: Russian <vdr@linuxtv.org>\n"
"Language: ru\n"

View File

@@ -238,9 +238,7 @@ cIptvSectionFilterHandler::cIptvSectionFilterHandler(int deviceIndexP, unsigned
cIptvSectionFilterHandler::~cIptvSectionFilterHandler()
{
debug("cIptvSectionFilterHandler::%s(%d)", __FUNCTION__, deviceIndexM);
// Stop thread
if (Running())
Cancel(3);
Stop();
DELETE_POINTER(ringBufferM);
@@ -250,6 +248,15 @@ cIptvSectionFilterHandler::~cIptvSectionFilterHandler()
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)
{
debug("cIptvSectionFilterHandler::%s(%d): entering", __FUNCTION__, deviceIndexM);
@@ -383,4 +390,3 @@ void cIptvSectionFilterHandler::Write(uchar *bufferP, int lengthP)
ringBufferM->ReportOverflow(lengthP - len);
}
}

View File

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