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

Modified SetChannelDevice() to report about unrecognized channel settings.

This commit is contained in:
Rolf Ahrenberg 2007-09-14 21:36:05 +00:00
parent 2153243dbd
commit 769fb684f2

View File

@ -3,7 +3,7 @@
* *
* See the README file for copyright information and how to reach the author. * See the README file for copyright information and how to reach the author.
* *
* $Id: device.c,v 1.10 2007/09/14 18:02:22 ajhseppa Exp $ * $Id: device.c,v 1.11 2007/09/14 21:36:05 rahrenbe Exp $
*/ */
#include "common.h" #include "common.h"
@ -77,14 +77,14 @@ cString cIptvDevice::GetChannelSettings(const char *Param, int *IpPort, cIptvPro
*Protocol = pUdpProtocol; *Protocol = pUdpProtocol;
return cString::sprintf("%u.%u.%u.%u", a, b, c, d); return cString::sprintf("%u.%u.%u.%u", a, b, c, d);
} }
else if (sscanf(Param, "IPTV-RTSP-%u.%u.%u.%u-%u", &a, &b, &c, &d, IpPort) == 5) { //else if (sscanf(Param, "IPTV-RTSP-%u.%u.%u.%u-%u", &a, &b, &c, &d, IpPort) == 5) {
*Protocol = NULL; // pRtspProtocol; // *Protocol = pRtspProtocol;
return cString::sprintf("%u.%u.%u.%u", a, b, c, d); // return cString::sprintf("%u.%u.%u.%u", a, b, c, d);
} // }
else if (sscanf(Param, "IPTV-HTTP-%u.%u.%u.%u-%u", &a, &b, &c, &d, IpPort) == 5) { //else if (sscanf(Param, "IPTV-HTTP-%u.%u.%u.%u-%u", &a, &b, &c, &d, IpPort) == 5) {
*Protocol = NULL; // pHttpProtocol; // *Protocol = pHttpProtocol;
return cString::sprintf("%u.%u.%u.%u", a, b, c, d); // return cString::sprintf("%u.%u.%u.%u", a, b, c, d);
} // }
return NULL; return NULL;
} }
@ -127,32 +127,31 @@ bool cIptvDevice::SetChannelDevice(const cChannel *Channel, bool LiveView)
debug("cIptvDevice::SetChannelDevice(%d)\n", deviceIndex); debug("cIptvDevice::SetChannelDevice(%d)\n", deviceIndex);
addr = GetChannelSettings(Channel->Param(), &port, &protocol); addr = GetChannelSettings(Channel->Param(), &port, &protocol);
if (addr) if (isempty(addr)) {
error("ERROR: Unrecognized IPTV channel settings: %d", Channel->Param());
return false;
}
pIptvStreamer->Set(addr, port, protocol); pIptvStreamer->Set(addr, port, protocol);
return true; return true;
} }
bool cIptvDevice::SetPid(cPidHandle *Handle, int Type, bool On) bool cIptvDevice::SetPid(cPidHandle *Handle, int Type, bool On)
{ {
debug("cIptvDevice::SetPid(%d)\n", deviceIndex); debug("cIptvDevice::SetPid(%d) Type=%d On=%d\n", deviceIndex, Type, On);
return true; return true;
} }
int cIptvDevice::OpenFilter(u_short Pid, u_char Tid, u_char Mask) int cIptvDevice::OpenFilter(u_short Pid, u_char Tid, u_char Mask)
{ {
int pipeDesc[2]; int pipeDesc[2];
debug("cIptvDevice::OpenFilter(): Pid=%d Tid=%02X Mask=%02X\n", Pid, Tid, Mask); debug("cIptvDevice::OpenFilter(): Pid=%d Tid=%02X Mask=%02X\n", Pid, Tid, Mask);
// Create a pipe // Create a pipe
if (pipe(pipeDesc) < 0) { if (pipe(pipeDesc) < 0) {
char tmp[64]; char tmp[64];
error("ERROR: pipe(): %s", strerror_r(errno, tmp, sizeof(tmp))); error("ERROR: pipe(): %s", strerror_r(errno, tmp, sizeof(tmp)));
} }
// Write pipe is used by the pid filtering class // Write pipe is used by the pid filtering class
// cReceiver Filter(pipeDesc[1], Pid, Tid, Mask) // cIptvSectionFilter Filter(pipeDesc[1], Pid, Tid, Mask)
// Give the read pipe to vdr // Give the read pipe to vdr
return pipeDesc[0]; return pipeDesc[0];
} }