From ccc9bab5e0d1c0e37fd61b6f412563f200b33abd Mon Sep 17 00:00:00 2001 From: Rolf Ahrenberg Date: Sat, 19 Sep 2015 17:20:56 +0300 Subject: [PATCH] Updated for vdr-2.3.1. --- HISTORY | 9 +++++++++ device.c | 3 ++- iptv.c | 6 +++--- pidscanner.c | 14 ++++++++------ po/de_DE.po | 2 +- po/fi_FI.po | 2 +- po/fr_FR.po | 2 +- po/it_IT.po | 2 +- po/lt_LT.po | 2 +- po/nl_NL.po | 2 +- po/ru_RU.po | 2 +- sidscanner.c | 14 +++++++++----- source.c | 2 +- 13 files changed, 39 insertions(+), 23 deletions(-) diff --git a/HISTORY b/HISTORY index 0ee3e03..7c85803 100644 --- a/HISTORY +++ b/HISTORY @@ -272,3 +272,12 @@ VDR Plugin 'iptv' Revision History detection (Thanks to Daniel Ribeiro). - Got rid of IPTV_DEBUG. - Added support for tracing modes. + + +================================== +VDR Plugin 'iptv' Revision History +================================== + +2015-XX-XX: Version 2.3.0 + +- Updated for vdr-2.3.1. diff --git a/device.c b/device.c index d94510a..8647b9c 100644 --- a/device.c +++ b/device.c @@ -125,12 +125,13 @@ cIptvDevice *cIptvDevice::GetIptvDevice(int cardIndexP) cString cIptvDevice::GetGeneralInformation(void) { debug16("%s [device %d]", __PRETTY_FUNCTION__, deviceIndexM); + LOCK_CHANNELS_READ; return cString::sprintf("IPTV device: %d\nCardIndex: %d\nStream: %s\nStream bitrate: %s\n%sChannel: %s", deviceIndexM, CardIndex(), pIptvStreamerM ? *pIptvStreamerM->GetInformation() : "", pIptvStreamerM ? *pIptvStreamerM->GetStreamerStatistic() : "", *GetBufferStatistic(), - *Channels.GetByNumber(cDevice::CurrentChannel())->ToText()); + *Channels->GetByNumber(cDevice::CurrentChannel())->ToText()); } cString cIptvDevice::GetPidsInformation(void) diff --git a/iptv.c b/iptv.c index 594bb59..f8e06ac 100644 --- a/iptv.c +++ b/iptv.c @@ -13,15 +13,15 @@ #include "device.h" #include "iptvservice.h" -#if defined(APIVERSNUM) && APIVERSNUM < 20200 -#error "VDR-2.2.0 API version or greater is required!" +#if defined(APIVERSNUM) && APIVERSNUM < 20301 +#error "VDR-2.3.1 API version or greater is required!" #endif #ifndef GITVERSION #define GITVERSION "" #endif - const char VERSION[] = "2.2.1" GITVERSION; + const char VERSION[] = "2.3.0" GITVERSION; static const char DESCRIPTION[] = trNOOP("Experience the IPTV"); class cPluginIptv : public cPlugin { diff --git a/pidscanner.c b/pidscanner.c index 80af34c..71ee9a8 100644 --- a/pidscanner.c +++ b/pidscanner.c @@ -108,11 +108,13 @@ void cPidScanner::Process(const uint8_t* bufP) if (((numVpidsM >= PIDSCANNER_VPID_COUNT) && (numApidsM >= PIDSCANNER_APID_COUNT)) || (abs(numApidsM - numVpidsM) >= PIDSCANNER_PID_DELTA_COUNT)) { // Lock channels for pid updates - if (!Channels.Lock(true, 10)) { - timeoutM.Set(PIDSCANNER_TIMEOUT_IN_MS); + timeoutM.Set(PIDSCANNER_TIMEOUT_IN_MS); + cStateKey StateKey; + cChannels *Channels = cChannels::GetChannelsWrite(StateKey, 10); + if (!Channels) return; - } - cChannel *IptvChannel = Channels.GetByChannelID(channelIdM); + bool ChannelsModified = false; + cChannel *IptvChannel = Channels->GetByChannelID(channelIdM); if (IptvChannel) { int Apids[MAXAPIDS + 1] = { 0 }; // these lists are zero-terminated int Atypes[MAXAPIDS + 1] = { 0 }; @@ -147,9 +149,9 @@ void cPidScanner::Process(const uint8_t* bufP) for (unsigned int i = 0; i < MAXSPIDS; ++i) Spids[i] = IptvChannel->Spid(i); debug1("%s vpid=0x%04X, apid=0x%04X", __PRETTY_FUNCTION__, vPidM, aPidM); - IptvChannel->SetPids(vPidM, Ppid, Vtype, Apids, Atypes, ALangs, Dpids, Dtypes, DLangs, Spids, SLangs, Tpid); + ChannelsModified |= IptvChannel->SetPids(vPidM, Ppid, Vtype, Apids, Atypes, ALangs, Dpids, Dtypes, DLangs, Spids, SLangs, Tpid); } - Channels.Unlock(); + StateKey.Remove(ChannelsModified); processM = false; } } diff --git a/po/de_DE.po b/po/de_DE.po index 3686e09..b646e46 100644 --- a/po/de_DE.po +++ b/po/de_DE.po @@ -6,7 +6,7 @@ # msgid "" msgstr "" -"Project-Id-Version: vdr-iptv 2.2.1\n" +"Project-Id-Version: vdr-iptv 2.3.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2015-04-04 04:04+0300\n" "PO-Revision-Date: 2015-04-04 04:04+0300\n" diff --git a/po/fi_FI.po b/po/fi_FI.po index 73090a5..cb96e1b 100644 --- a/po/fi_FI.po +++ b/po/fi_FI.po @@ -5,7 +5,7 @@ # msgid "" msgstr "" -"Project-Id-Version: vdr-iptv 2.2.1\n" +"Project-Id-Version: vdr-iptv 2.3.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2015-04-04 04:04+0300\n" "PO-Revision-Date: 2015-04-04 04:04+0300\n" diff --git a/po/fr_FR.po b/po/fr_FR.po index 5aecacc..6058649 100644 --- a/po/fr_FR.po +++ b/po/fr_FR.po @@ -6,7 +6,7 @@ # msgid "" msgstr "" -"Project-Id-Version: vdr-iptv 2.2.1\n" +"Project-Id-Version: vdr-iptv 2.3.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2015-04-04 04:04+0300\n" "PO-Revision-Date: 2015-04-04 04:04+0300\n" diff --git a/po/it_IT.po b/po/it_IT.po index 26f0e90..972998b 100644 --- a/po/it_IT.po +++ b/po/it_IT.po @@ -5,7 +5,7 @@ # msgid "" msgstr "" -"Project-Id-Version: vdr-iptv 2.2.1\n" +"Project-Id-Version: vdr-iptv 2.3.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2015-04-04 04:04+0300\n" "PO-Revision-Date: 2015-04-04 04:04+0300\n" diff --git a/po/lt_LT.po b/po/lt_LT.po index 2b0bea0..fd2b7a3 100644 --- a/po/lt_LT.po +++ b/po/lt_LT.po @@ -5,7 +5,7 @@ # msgid "" msgstr "" -"Project-Id-Version: vdr-iptv 2.2.1\n" +"Project-Id-Version: vdr-iptv 2.3.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2015-04-04 04:04+0300\n" "PO-Revision-Date: 2015-04-04 04:04+0300\n" diff --git a/po/nl_NL.po b/po/nl_NL.po index 7689869..52e7db4 100644 --- a/po/nl_NL.po +++ b/po/nl_NL.po @@ -5,7 +5,7 @@ # msgid "" msgstr "" -"Project-Id-Version: vdr-iptv 2.2.1\n" +"Project-Id-Version: vdr-iptv 2.3.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2015-04-04 04:04+0300\n" "PO-Revision-Date: 2015-04-04 04:04+0300\n" diff --git a/po/ru_RU.po b/po/ru_RU.po index 4afba74..23d97be 100644 --- a/po/ru_RU.po +++ b/po/ru_RU.po @@ -5,7 +5,7 @@ # msgid "" msgstr "" -"Project-Id-Version: vdr-iptv 2.2.1\n" +"Project-Id-Version: vdr-iptv 2.3.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2015-04-04 04:04+0300\n" "PO-Revision-Date: 2015-04-04 04:04+0300\n" diff --git a/sidscanner.c b/sidscanner.c index 098d51d..b46faef 100644 --- a/sidscanner.c +++ b/sidscanner.c @@ -89,13 +89,17 @@ void cSidScanner::Process(u_short pidP, u_char tidP, const u_char *dataP, int le } } if ((newSid >= 0) || (newNid >= 0) || (newTid >= 0)) { - if (!Channels.Lock(true, 10)) + cStateKey StateKey; + cChannels *Channels = cChannels::GetChannelsWrite(StateKey, 10); + if (!Channels) return; - cChannel *IptvChannel = Channels.GetByChannelID(channelIdM); + bool ChannelsModified = false; + cChannel *IptvChannel = Channels->GetByChannelID(channelIdM); if (IptvChannel) - IptvChannel->SetId((newNid < 0) ? IptvChannel->Nid() : newNid, (newTid < 0) ? IptvChannel->Tid() : newTid, - (newSid < 0) ? IptvChannel->Sid() : newSid, IptvChannel->Rid()); - Channels.Unlock(); + ChannelsModified |= IptvChannel->SetId(Channels, (newNid < 0) ? IptvChannel->Nid() : newNid, + (newTid < 0) ? IptvChannel->Tid() : newTid, + (newSid < 0) ? IptvChannel->Sid() : newSid, IptvChannel->Rid()); + StateKey.Remove(ChannelsModified); } if (sidFoundM && nidFoundM && tidFoundM) { SetChannel(tChannelID::InvalidID); diff --git a/source.c b/source.c index f737107..08571ca 100644 --- a/source.c +++ b/source.c @@ -164,7 +164,7 @@ void cIptvSourceParam::GetData(cChannel *channelP) { debug1("%s (%s)", __PRETTY_FUNCTION__, channelP->Parameters()); channelP->SetTransponderData(channelP->Source(), channelP->Frequency(), dataM.Srate(), itpM.ToString(Source()), true); - channelP->SetId(channelP->Nid(), channelP->Tid(), channelP->Sid(), ridM); + channelP->SetId(NULL, channelP->Nid(), channelP->Tid(), channelP->Sid(), ridM); } cOsdItem *cIptvSourceParam::GetOsdItem(void)