mirror of
				https://github.com/rofafor/vdr-plugin-iptv.git
				synced 2023-10-10 11:37:03 +00:00 
			
		
		
		
	Added support for cDevice::GetCurrentlyTunedTransponder().
This commit is contained in:
		
							
								
								
									
										3
									
								
								HISTORY
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								HISTORY
									
									
									
									
									
								
							@@ -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.
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										17
									
								
								device.c
									
									
									
									
									
								
							
							
						
						
									
										17
									
								
								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);
 | 
			
		||||
@@ -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;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										3
									
								
								device.h
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								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,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);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user