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

Added support for cDevice::GetCurrentlyTunedTransponder().

This commit is contained in:
Rolf Ahrenberg 2014-01-10 23:59:26 +02:00
parent 6f648401a4
commit 767b1bdac7
3 changed files with 15 additions and 8 deletions

View File

@ -217,5 +217,6 @@ VDR Plugin 'iptv' Revision History
- Added missing CURL timeouts.
- Improved section id scanner.
- Added support for cDevice::IsTunedToTransponder().
- Added support for cDevice::IsTunedToTransponder() and
cDevice::GetCurrentlyTunedTransponder().
- Fixed a memory leak and some issues reported by scan-build.

View File

@ -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);
@ -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,9 +235,14 @@ 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() == channelIdM) : false;
return channelP ? (channelP->GetChannelID() == channelM.GetChannelID()) : false;
}
bool cIptvDevice::SetChannelDevice(const cChannel *channelP, bool liveViewP)
@ -275,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;
}

View File

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