From e798ff1424bec20de78d7fdcaacc1a41f37d5718 Mon Sep 17 00:00:00 2001 From: Rolf Ahrenberg Date: Wed, 2 Apr 2008 20:22:48 +0000 Subject: [PATCH] Removed old channels.conf format support and disabled re-tuning of EXT protocol. --- HISTORY | 2 ++ device.c | 37 +++++++------------------------------ setup.c | 25 +------------------------ streamer.c | 18 ++++++++++++++---- streamer.h | 5 ++++- 5 files changed, 28 insertions(+), 59 deletions(-) diff --git a/HISTORY b/HISTORY index 7ff9628..dbb393b 100644 --- a/HISTORY +++ b/HISTORY @@ -59,3 +59,5 @@ VDR Plugin 'iptv' Revision History 2008-xx-xx: Version 0.2.1 - Updated Italian translation (Thanks to Diego Pierotto). +- Removed compatibility mode for old channels.conf format. +- EXT protocol is re-tuned only if iptv parameters differ. diff --git a/device.c b/device.c index c8921df..f507298 100644 --- a/device.c +++ b/device.c @@ -3,7 +3,7 @@ * * See the README file for copyright information and how to reach the author. * - * $Id: device.c,v 1.85 2008/02/19 22:29:02 rahrenbe Exp $ + * $Id: device.c,v 1.86 2008/04/02 20:22:48 rahrenbe Exp $ */ #include "config.h" @@ -225,30 +225,6 @@ cString cIptvDevice::GetChannelSettings(const char *IptvParam, int *Parameter, i return locstr; } } - // compatibility mode for old channels.conf format - else if (sscanf(IptvParam, "%a[^|]|%a[^|]|%a[^|]|%u", &tag, &proto, &loc, Parameter) == 4) { - cString tagstr(tag, true); - cString protostr(proto, true); - cString locstr(loc, true); - *SidScan = 0; - *PidScan = 0; - // check if IPTV tag - if (strncasecmp(*tagstr, "IPTV", 4) == 0) { - // check if protocol is supported and update the pointer - if (strncasecmp(*protostr, "UDP", 3) == 0) - *Protocol = pUdpProtocol; - else if (strncasecmp(*protostr, "HTTP", 4) == 0) - *Protocol = pHttpProtocol; - else if (strncasecmp(*protostr, "FILE", 4) == 0) - *Protocol = pFileProtocol; - else if (strncasecmp(*protostr, "EXT", 3) == 0) - *Protocol = pExtProtocol; - else - return NULL; - // return location - return locstr; - } - } return NULL; } @@ -302,11 +278,12 @@ bool cIptvDevice::SetChannelDevice(const cChannel *Channel, bool LiveView) } sidScanEnabled = sidscan ? true : false; pidScanEnabled = pidscan ? true : false; - pIptvStreamer->Set(location, parameter, deviceIndex, protocol); - if (sidScanEnabled && pSidScanner && IptvConfig.GetSectionFiltering()) - pSidScanner->SetChannel(Channel); - if (pidScanEnabled && pPidScanner) - pPidScanner->SetChannel(Channel); + if (pIptvStreamer->Set(location, parameter, deviceIndex, protocol)) { + if (sidScanEnabled && pSidScanner && IptvConfig.GetSectionFiltering()) + pSidScanner->SetChannel(Channel); + if (pidScanEnabled && pPidScanner) + pPidScanner->SetChannel(Channel); + } return true; } diff --git a/setup.c b/setup.c index b3ee265..96bd634 100644 --- a/setup.c +++ b/setup.c @@ -3,7 +3,7 @@ * * See the README file for copyright information and how to reach the author. * - * $Id: setup.c,v 1.57 2008/02/19 22:29:02 rahrenbe Exp $ + * $Id: setup.c,v 1.58 2008/04/02 20:22:48 rahrenbe Exp $ */ #include @@ -117,29 +117,6 @@ cString cIptvMenuEditChannel::GetIptvSettings(const char *Param, int *Parameter, return locstr; } } - else if (sscanf(Param, "%a[^|]|%a[^|]|%a[^|]|%d", &tag, &proto, &loc, Parameter) == 4) { - cString tagstr(tag, true); - cString protostr(proto, true); - cString locstr(loc, true); - *SidScan = 0; - *PidScan = 0; - // check if IPTV tag - if (strncasecmp(*tagstr, "IPTV", 4) == 0) { - // check if protocol is supported and update the pointer - if (strncasecmp(*protostr, "UDP", 3) == 0) - *Protocol = eProtocolUDP; - else if (strncasecmp(*protostr, "HTTP", 4) == 0) - *Protocol = eProtocolHTTP; - else if (strncasecmp(*protostr, "FILE", 4) == 0) - *Protocol = eProtocolFILE; - else if (strncasecmp(*protostr, "EXT", 3) == 0) - *Protocol = eProtocolEXT; - else - return NULL; - // return location - return locstr; - } - } return NULL; } diff --git a/streamer.c b/streamer.c index c69c3c4..d6976af 100644 --- a/streamer.c +++ b/streamer.c @@ -3,7 +3,7 @@ * * See the README file for copyright information and how to reach the author. * - * $Id: streamer.c,v 1.30 2008/01/30 21:57:33 rahrenbe Exp $ + * $Id: streamer.c,v 1.31 2008/04/02 20:22:48 rahrenbe Exp $ */ #include @@ -16,7 +16,10 @@ cIptvStreamer::cIptvStreamer(cRingBufferLinear* RingBuffer, cMutex* Mutex) : cThread("IPTV streamer"), ringBuffer(RingBuffer), mutex(Mutex), - protocol(NULL) + protocol(NULL), + location(NULL), + parameter(-1), + index(-1) { debug("cIptvStreamer::cIptvStreamer()\n"); } @@ -89,6 +92,9 @@ bool cIptvStreamer::Set(const char* Location, const int Parameter, const int Ind { debug("cIptvStreamer::Set(): %s:%d\n", Location, Parameter); if (!isempty(Location)) { + // + if (!strcmp(*location, Location) && (parameter == Parameter) && (index == Index) && (protocol == Protocol)) + return false; // Update protocol; Close the existing one if changed if (protocol != Protocol) { if (protocol) @@ -98,8 +104,12 @@ bool cIptvStreamer::Set(const char* Location, const int Parameter, const int Ind protocol->Open(); } // Set protocol location and parameter - if (protocol) - protocol->Set(Location, Parameter, Index); + if (protocol) { + location = cString(Location); + parameter = Parameter; + index = Index; + protocol->Set(location, parameter, index); + } } return true; } diff --git a/streamer.h b/streamer.h index 627e199..215d355 100644 --- a/streamer.h +++ b/streamer.h @@ -3,7 +3,7 @@ * * See the README file for copyright information and how to reach the author. * - * $Id: streamer.h,v 1.14 2008/01/30 21:57:33 rahrenbe Exp $ + * $Id: streamer.h,v 1.15 2008/04/02 20:22:48 rahrenbe Exp $ */ #ifndef __IPTV_STREAMER_H @@ -24,6 +24,9 @@ private: unsigned char* readBuffer; unsigned int readBufferLen; cIptvProtocolIf* protocol; + cString location; + int parameter; + int index; public: cIptvStreamer(cRingBufferLinear* RingBuffer, cMutex* Mutex);