Removed old channels.conf format support and disabled re-tuning of EXT protocol.

This commit is contained in:
Rolf Ahrenberg 2008-04-02 20:22:48 +00:00
parent 613152c6db
commit e798ff1424
5 changed files with 28 additions and 59 deletions

View File

@ -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.

View File

@ -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;
}

25
setup.c
View File

@ -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 <string.h>
@ -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;
}

View File

@ -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 <vdr/thread.h>
@ -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;
}

View File

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