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

Added some funky moves.

This commit is contained in:
Rolf Ahrenberg 2008-01-30 21:57:33 +00:00
parent c176429338
commit 29cb25485f
18 changed files with 174 additions and 125 deletions

View File

@ -3,7 +3,7 @@
*
* See the README file for copyright information and how to reach the author.
*
* $Id: common.c,v 1.9 2008/01/04 23:36:37 ajhseppa Exp $
* $Id: common.c,v 1.10 2008/01/30 21:57:33 rahrenbe Exp $
*/
#include <vdr/tools.h>
@ -50,9 +50,9 @@ int select_single_desc(int descriptor, const int usecs, const bool selectWrite)
FD_SET(descriptor, &fds);
int retval = 0;
if (selectWrite)
retval = select(descriptor + 1, NULL, &fds, NULL, &tv);
retval = select(descriptor + 1, NULL, &fds, NULL, &tv);
else
retval = select(descriptor + 1, &fds, NULL, NULL, &tv);
retval = select(descriptor + 1, &fds, NULL, NULL, &tv);
// Check if error
ERROR_IF_RET(retval < 0, "select()", return retval);
return retval;

View File

@ -3,7 +3,7 @@
*
* See the README file for copyright information and how to reach the author.
*
* $Id: config.c,v 1.19 2008/01/04 23:36:37 ajhseppa Exp $
* $Id: config.c,v 1.20 2008/01/30 21:57:33 rahrenbe Exp $
*/
#include "config.h"
@ -17,7 +17,8 @@ cIptvConfig::cIptvConfig(void)
extProtocolBasePort(4321),
useBytes(1),
sectionFiltering(1),
sidScanning(1)
sidScanning(1),
pidScanning(0)
{
for (unsigned int i = 0; i < ARRAY_SIZE(disabledFilters) - 1; ++i)
disabledFilters[i] = -1;

View File

@ -3,7 +3,7 @@
*
* See the README file for copyright information and how to reach the author.
*
* $Id: config.h,v 1.18 2008/01/04 23:36:37 ajhseppa Exp $
* $Id: config.h,v 1.19 2008/01/30 21:57:33 rahrenbe Exp $
*/
#ifndef __IPTV_CONFIG_H
@ -22,6 +22,7 @@ private:
unsigned int useBytes;
unsigned int sectionFiltering;
unsigned int sidScanning;
unsigned int pidScanning;
int disabledFilters[SECTION_FILTER_TABLE_SIZE];
char configDirectory[255];
@ -34,6 +35,7 @@ public:
unsigned int GetUseBytes(void) const { return useBytes; }
unsigned int GetSectionFiltering(void) const { return sectionFiltering; }
unsigned int GetSidScanning(void) const { return sidScanning; }
unsigned int GetPidScanning(void) const { return pidScanning; }
const char *GetConfigDirectory(void) const { return configDirectory; }
unsigned int GetDisabledFiltersCount(void) const;
int GetDisabledFilters(unsigned int Index) const;
@ -43,6 +45,7 @@ public:
void SetUseBytes(unsigned int On) { useBytes = On; }
void SetSectionFiltering(unsigned int On) { sectionFiltering = On; }
void SetSidScanning(unsigned int On) { sidScanning = On; }
void SetPidScanning(unsigned int On) { pidScanning = On; }
void SetDisabledFilters(unsigned int Index, int Number);
void SetConfigDirectory(const char *directoryP);
};

View File

@ -3,7 +3,7 @@
*
* See the README file for copyright information and how to reach the author.
*
* $Id: device.c,v 1.79 2008/01/28 21:36:32 rahrenbe Exp $
* $Id: device.c,v 1.80 2008/01/30 21:57:33 rahrenbe Exp $
*/
#include "config.h"
@ -326,7 +326,7 @@ void cIptvDevice::CloseDvr(void)
if (pSidScanner && IptvConfig.GetSectionFiltering() && IptvConfig.GetSidScanning())
pSidScanner->SetStatus(false);
if (pIptvStreamer)
pIptvStreamer->Close();
pIptvStreamer->Close();
isOpenDvr = false;
}

42
iptv.c
View File

@ -3,7 +3,7 @@
*
* See the README file for copyright information and how to reach the author.
*
* $Id: iptv.c,v 1.34 2008/01/26 20:45:25 rahrenbe Exp $
* $Id: iptv.c,v 1.35 2008/01/30 21:57:33 rahrenbe Exp $
*/
#include <getopt.h>
@ -79,20 +79,20 @@ bool cPluginIptv::ProcessArgs(int argc, char *argv[])
debug("cPluginIptv::ProcessArgs()\n");
// Implement command line argument processing here if applicable.
static const struct option long_options[] = {
{ "devices", required_argument, NULL, 'd' },
{ NULL }
};
{ "devices", required_argument, NULL, 'd' },
{ NULL }
};
int c;
while ((c = getopt_long(argc, argv, "d:", long_options, NULL)) != -1) {
switch (c) {
case 'd':
deviceCount = atoi(optarg);
break;
default:
return false;
}
}
switch (c) {
case 'd':
deviceCount = atoi(optarg);
break;
default:
return false;
}
}
return true;
}
@ -167,14 +167,14 @@ int cPluginIptv::ParseFilters(const char *Value, int *Filters)
char buffer[256];
int n = 0;
while (Value && *Value && (n < SECTION_FILTER_TABLE_SIZE)) {
strn0cpy(buffer, Value, sizeof(buffer));
int i = atoi(buffer);
//debug("cPluginIptv::ParseFilters(): Filters[%d]=%d\n", n, i);
if (i >= 0)
Filters[n++] = i;
if ((Value = strchr(Value, ' ')) != NULL)
Value++;
}
strn0cpy(buffer, Value, sizeof(buffer));
int i = atoi(buffer);
//debug("cPluginIptv::ParseFilters(): Filters[%d]=%d\n", n, i);
if (i >= 0)
Filters[n++] = i;
if ((Value = strchr(Value, ' ')) != NULL)
Value++;
}
return n;
}
@ -192,6 +192,8 @@ bool cPluginIptv::SetupParse(const char *Name, const char *Value)
IptvConfig.SetSectionFiltering(atoi(Value));
else if (!strcasecmp(Name, "SidScanning"))
IptvConfig.SetSidScanning(atoi(Value));
else if (!strcasecmp(Name, "PidScanning"))
IptvConfig.SetPidScanning(atoi(Value));
else if (!strcasecmp(Name, "DisabledFilters")) {
int DisabledFilters[SECTION_FILTER_TABLE_SIZE];
for (unsigned int i = 0; i < ARRAY_SIZE(DisabledFilters); ++i)

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: iptv 0.0.6\n"
"Report-Msgid-Bugs-To: Rolf Ahrenberg\n"
"POT-Creation-Date: 2008-01-20 16:10+0200\n"
"POT-Creation-Date: 2008-01-30 23:53+0200\n"
"PO-Revision-Date: 2007-10-29 21:19+0100\n"
"Last-Translator: Tobias Grimm <tg@e-tobi.net>\n"
"Language-Team: German\n"
@ -130,6 +130,15 @@ msgid ""
"The port range is defined by the number of IPTV devices. This setting sets the port which is listened for connections from external applications when using the EXT protocol."
msgstr ""
msgid "Scan Pid automatically"
msgstr "Scanne PID automatisch"
msgid ""
"Define whether program ids shall be scanned automatically.\n"
"\n"
"Automatic Pid scanning helps VDR to detect changed pids of streams."
msgstr ""
msgid "Use section filtering"
msgstr "Benutze Abschnittsfilterung"

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: iptv 0.0.6\n"
"Report-Msgid-Bugs-To: Rolf Ahrenberg\n"
"POT-Creation-Date: 2008-01-20 15:37+0200\n"
"POT-Creation-Date: 2008-01-30 23:53+0200\n"
"PO-Revision-Date: 2007-08-12 23:22+0300\n"
"Last-Translator: Rolf Ahrenberg\n"
"Language-Team: <vdr@linuxtv.org>\n"
@ -138,6 +138,18 @@ msgstr ""
"\n"
"Porttiavaruuden koko määräytyy käytettyjen IPTV-laitteiden mukaan. Laajennos lukee EXT-protokollan yhteydessä perusportista dataa, jota ulkoiset ohjelmistot tarjoavat."
msgid "Scan Pid automatically"
msgstr "Etsi ohjelmatunnisteet automaattisesti"
msgid ""
"Define whether program ids shall be scanned automatically.\n"
"\n"
"Automatic Pid scanning helps VDR to detect changed pids of streams."
msgstr ""
"Määrittele etsitäänkö ohjelmatunnisteet (PID) automaattisesti.\n"
"\n"
"Automaattinen ohjelmatunnisteiden etsintä auttaa VDR:ää havaitsemaan ohjelmatunnisteiden muutokset lähetteestä."
msgid "Use section filtering"
msgstr "Käytä sektioiden suodatusta"
@ -162,7 +174,7 @@ msgid ""
msgstr ""
"Määrittele etsitäänkö palvelutunniste (SID) automaattisesti.\n"
"\n"
"Asetus vaatii suodatuksen käyttöönoton sektioille. Automaattinen palvelutunnisteen (SID) etsintä auttaa VDR:ää havaitsemaan ohjelmatunnisteiden (PID) muutokset lähetteestä."
"Asetus vaatii suodatuksen käyttöönoton sektioille. Automaattinen palvelutunnisteen etsintä auttaa VDR:ää havaitsemaan ohjelmatunnisteiden (PID) muutokset lähetteestä."
msgid "Disable filters"
msgstr "Poista suodattimia käytöstä"

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: iptv 0.0.6\n"
"Report-Msgid-Bugs-To: Rolf Ahrenberg\n"
"POT-Creation-Date: 2008-01-20 16:10+0200\n"
"POT-Creation-Date: 2008-01-30 23:53+0200\n"
"PO-Revision-Date: 2008-01-26 13:14+0100\n"
"Last-Translator: NIVAL Michaël <mnival@club-internet.fr>\n"
"Language-Team: French\n"
@ -140,6 +140,15 @@ msgstr ""
"\n"
"La plage de port est défini par le nombre de dispositif IPTV. Ce paramètre défini le port qui est écouté pour les connexions à partir d'applications externes en utilisant le protocole EXT."
msgid "Scan Pid automatically"
msgstr "Scanne les PID automatiquement"
msgid ""
"Define whether program ids shall be scanned automatically.\n"
"\n"
"Automatic Pid scanning helps VDR to detect changed pids of streams."
msgstr ""
msgid "Use section filtering"
msgstr "Utiliser le filtrage de section"

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: iptv 0.0.6\n"
"Report-Msgid-Bugs-To: Rolf Ahrenberg\n"
"POT-Creation-Date: 2008-01-20 16:10+0200\n"
"POT-Creation-Date: 2008-01-30 23:53+0200\n"
"PO-Revision-Date: 2008-01-13 16:46+0100\n"
"Last-Translator: Gringo <vdr-italian@tiscali.it>\n"
"Language-Team: Italian\n"
@ -130,6 +130,15 @@ msgid ""
"The port range is defined by the number of IPTV devices. This setting sets the port which is listened for connections from external applications when using the EXT protocol."
msgstr ""
msgid "Scan Pid automatically"
msgstr "Scansione Pid automatica"
msgid ""
"Define whether program ids shall be scanned automatically.\n"
"\n"
"Automatic Pid scanning helps VDR to detect changed pids of streams."
msgstr ""
msgid "Use section filtering"
msgstr "Utilizza sezione filtri"

View File

@ -3,7 +3,7 @@
*
* See the README file for copyright information and how to reach the author.
*
* $Id: protocolext.c,v 1.22 2008/01/06 20:19:02 rahrenbe Exp $
* $Id: protocolext.c,v 1.23 2008/01/30 21:57:33 rahrenbe Exp $
*/
#include <sys/wait.h>
@ -115,7 +115,7 @@ bool cIptvProtocolExt::Open(void)
debug("cIptvProtocolExt::Open()\n");
// Reject empty script files
if (!strlen(scriptFile))
return false;
return false;
// Create the listening socket
OpenSocket(socketPort);
// Execute the external script

View File

@ -3,7 +3,7 @@
*
* See the README file for copyright information and how to reach the author.
*
* $Id: protocolhttp.c,v 1.22 2008/01/04 23:36:37 ajhseppa Exp $
* $Id: protocolhttp.c,v 1.23 2008/01/30 21:57:33 rahrenbe Exp $
*/
#include <sys/types.h>
@ -119,10 +119,10 @@ bool cIptvProtocolHttp::Disconnect(void)
debug("cIptvProtocolHttp::Disconnect()\n");
// Check that stream address is valid
if (isActive) {
// Close the socket
CloseSocket();
// Update active flag
isActive = false;
// Close the socket
CloseSocket();
// Update active flag
isActive = false;
}
return true;
}
@ -228,22 +228,22 @@ bool cIptvProtocolHttp::Set(const char* Location, const int Parameter, const int
{
debug("cIptvProtocolHttp::Set(): Location=%s Parameter=%d Index=%d\n", Location, Parameter, Index);
if (!isempty(Location)) {
// Disconnect the current socket
Disconnect();
// Update stream address, path and port
streamAddr = strcpyrealloc(streamAddr, Location);
char *path = strstr(streamAddr, "/");
if (path) {
streamPath = strcpyrealloc(streamPath, path);
*path = 0;
}
else
streamPath = strcpyrealloc(streamPath, "/");
socketPort = Parameter;
debug("http://%s:%d%s\n", streamAddr, socketPort, streamPath);
// Re-connect the socket
Connect();
}
// Disconnect the current socket
Disconnect();
// Update stream address, path and port
streamAddr = strcpyrealloc(streamAddr, Location);
char *path = strstr(streamAddr, "/");
if (path) {
streamPath = strcpyrealloc(streamPath, path);
*path = 0;
}
else
streamPath = strcpyrealloc(streamPath, "/");
socketPort = Parameter;
debug("http://%s:%d%s\n", streamAddr, socketPort, streamPath);
// Re-connect the socket
Connect();
}
return true;
}

View File

@ -3,7 +3,7 @@
*
* See the README file for copyright information and how to reach the author.
*
* $Id: protocolif.h,v 1.7 2007/10/19 22:18:55 rahrenbe Exp $
* $Id: protocolif.h,v 1.8 2008/01/30 21:57:33 rahrenbe Exp $
*/
#ifndef __IPTV_PROTOCOLIF_H
@ -20,8 +20,8 @@ public:
virtual cString GetInformation(void) = 0;
private:
cIptvProtocolIf(const cIptvProtocolIf&);
cIptvProtocolIf& operator=(const cIptvProtocolIf&);
cIptvProtocolIf(const cIptvProtocolIf&);
cIptvProtocolIf& operator=(const cIptvProtocolIf&);
};
#endif // __IPTV_PROTOCOLIF_H

View File

@ -3,7 +3,7 @@
*
* See the README file for copyright information and how to reach the author.
*
* $Id: sectionfilter.c,v 1.17 2008/01/19 21:08:02 ajhseppa Exp $
* $Id: sectionfilter.c,v 1.18 2008/01/30 21:57:33 rahrenbe Exp $
*/
#include "sectionfilter.h"
@ -38,17 +38,16 @@ cIptvSectionFilter::cIptvSectionFilter(int Index, int devInd,
filter_mask[0] = Mask;
// Invert the filter
for (int i = 0; i < DMX_MAX_FILTER_SIZE; ++i) {
for (int i = 0; i < DMX_MAX_FILTER_SIZE; ++i)
filter_value[i] ^= 0xff;
}
uint8_t mask, mode, local_doneq = 0;
for (int i = 0; i < DMX_MAX_FILTER_SIZE; i++) {
mode = filter_mode[i];
mask = filter_mask[i];
maskandmode[i] = mask & mode;
local_doneq |= maskandnotmode[i] = mask & ~mode;
}
for (int i = 0; i < DMX_MAX_FILTER_SIZE; ++i) {
mode = filter_mode[i];
mask = filter_mask[i];
maskandmode[i] = mask & mode;
local_doneq |= maskandnotmode[i] = mask & ~mode;
}
doneq = local_doneq ? 1 : 0;
struct stat sb;
@ -115,8 +114,6 @@ int cIptvSectionFilter::dmxdev_section_callback(const uint8_t *buffer1, size_t b
return 0;
}
void cIptvSectionFilter::demux_swfilter_section_new()
{
#ifdef DEMUX_SECTION_LOSS_LOG
@ -131,7 +128,7 @@ void cIptvSectionFilter::demux_swfilter_section_new()
printf("sectionfilter.c section ts padding loss: %d/%d\n",
n, tsfeedp);
printf("sectionfilter.c pad data:");
for (i = 0; i < n; i++)
for (i = 0; i < n; ++i)
printf(" %02x", secbuf[i]);
printf("\n");
}
@ -146,7 +143,7 @@ int cIptvSectionFilter::demux_swfilter_sectionfilter()
uint8_t neq = 0;
int i;
for (i = 0; i < DMX_MAX_FILTER_SIZE; i++) {
for (i = 0; i < DMX_MAX_FILTER_SIZE; ++i) {
uint8_t local_xor = filter_value[i] ^ secbuf[i];
if (maskandmode[i] & local_xor) {
#ifdef DEBUG_PRINTF
@ -206,7 +203,7 @@ int cIptvSectionFilter::demux_swfilter_section_copy_dump(const uint8_t *buf, uin
/* to be sure always set secbuf */
secbuf = secbuf_base + secbufp;
for (n = 0; secbufp + 2 < limit; n++) {
for (n = 0; secbufp + 2 < limit; ++n) {
seclen_local = section_length(secbuf);
if (seclen_local <= 0 || seclen_local > DMX_MAX_SECTION_SIZE ||
seclen_local + secbufp > limit)

82
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.50 2008/01/20 16:15:14 rahrenbe Exp $
* $Id: setup.c,v 1.51 2008/01/30 21:57:33 rahrenbe Exp $
*/
#include <string.h>
@ -257,44 +257,44 @@ eOSState cIptvMenuEditChannel::ProcessKey(eKeys Key)
bool firstIncrement = true;
// Search for identical channels as these will be ignored by vdr
for (cChannel *iteratorChannel = Channels.First(); iteratorChannel;
iteratorChannel = Channels.Next(iteratorChannel)) {
// This is one of the channels cause the uniquity check to fail
if (!iteratorChannel->GroupSep() && iteratorChannel != channel
&& iteratorChannel->GetChannelID() == newchannel.GetChannelID()) {
// See if it has unique Plugin param. If yes then increment
// the corresponding Rid until it is unique
if (strcmp(iteratorChannel->PluginParam(),
newchannel.PluginParam())) {
// If the channel RID is already at maximum, then fail the
// channel modification
if (iteratorChannel->Rid() >= 0x1FFF) {
debug("Cannot increment RID over maximum value\n");
uniquityFailed = true;
break;
}
debug("Incrementing conflicting channel RID\n");
iteratorChannel->SetId(iteratorChannel->Nid(),
iteratorChannel->Tid(),
iteratorChannel->Sid(),
firstIncrement ?
0 : iteratorChannel->Rid() + 1);
iteratorChannel = Channels.Next(iteratorChannel)) {
// This is one of the channels cause the uniquity check to fail
if (!iteratorChannel->GroupSep() && iteratorChannel != channel &&
iteratorChannel->GetChannelID() == newchannel.GetChannelID()) {
// See if it has unique Plugin param. If yes then increment
// the corresponding Rid until it is unique
if (strcmp(iteratorChannel->PluginParam(),
newchannel.PluginParam())) {
// If the channel RID is already at maximum, then fail the
// channel modification
if (iteratorChannel->Rid() >= 0x1FFF) {
debug("Cannot increment RID over maximum value\n");
uniquityFailed = true;
break;
}
debug("Incrementing conflicting channel RID\n");
iteratorChannel->SetId(iteratorChannel->Nid(),
iteratorChannel->Tid(),
iteratorChannel->Sid(),
firstIncrement ?
0 : iteratorChannel->Rid() + 1);
// Try zero Rid:s at first increment. Prevents them from
// creeping slowly towards their maximum value
firstIncrement = false;
// Try zero Rid:s at first increment. Prevents them from
// creeping slowly towards their maximum value
firstIncrement = false;
// Re-set the search and start again
iteratorChannel = Channels.First();
continue;
// Cannot work around by incrementing rid because channels
// are actually copies of each other
}
else {
uniquityFailed = true;
break;
}
}
}
// Re-set the search and start again
iteratorChannel = Channels.First();
continue;
// Cannot work around by incrementing rid because channels
// are actually copies of each other
}
else {
uniquityFailed = true;
break;
}
}
}
if (!uniquityFailed) {
if (channel) {
SetChannelData(channel);
@ -623,6 +623,7 @@ cIptvPluginSetup::cIptvPluginSetup()
extProtocolBasePort = IptvConfig.GetExtProtocolBasePort();
sectionFiltering = IptvConfig.GetSectionFiltering();
sidScanning = IptvConfig.GetSidScanning();
pidScanning = IptvConfig.GetPidScanning();
numDisabledFilters = IptvConfig.GetDisabledFiltersCount();
if (numDisabledFilters > SECTION_FILTER_TABLE_SIZE)
numDisabledFilters = SECTION_FILTER_TABLE_SIZE;
@ -658,6 +659,11 @@ void cIptvPluginSetup::Setup(void)
help.Append(tr("Define a base port used by EXT protocol.\n\nThe port range is defined by the number of IPTV devices. This setting sets the port which is listened for connections from external applications when using the EXT protocol."));
#endif
Add(new cMenuEditBoolItem(tr("Scan Pid automatically"), &pidScanning));
#if defined(APIVERSNUM) && APIVERSNUM >= 10513
help.Append(tr("Define whether program ids shall be scanned automatically.\n\nAutomatic Pid scanning helps VDR to detect changed pids of streams."));
#endif
Add(new cMenuEditBoolItem(tr("Use section filtering"), &sectionFiltering));
#if defined(APIVERSNUM) && APIVERSNUM >= 10513
help.Append(tr("Define whether the section filtering shall be used.\n\nSection filtering means that IPTV plugin tries to parse and provide VDR with secondary data about the currently active stream. VDR can then use this data for providing various functionalities such as automatic pid change detection and EPG etc.\nEnabling this feature does not affect streams that do not contain section data."));
@ -757,6 +763,7 @@ void cIptvPluginSetup::Store(void)
SetupStore("ExtProtocolBasePort", extProtocolBasePort);
SetupStore("SectionFiltering", sectionFiltering);
SetupStore("SidScanning", sidScanning);
SetupStore("PidScanning", pidScanning);
StoreFilters("DisabledFilters", disabledFilterIndexes);
// Update global config
IptvConfig.SetTsBufferSize(tsBufferSize);
@ -764,6 +771,7 @@ void cIptvPluginSetup::Store(void)
IptvConfig.SetExtProtocolBasePort(extProtocolBasePort);
IptvConfig.SetSectionFiltering(sectionFiltering);
IptvConfig.SetSidScanning(sidScanning);
IptvConfig.SetPidScanning(pidScanning);
for (int i = 0; i < SECTION_FILTER_TABLE_SIZE; ++i)
IptvConfig.SetDisabledFilters(i, disabledFilterIndexes[i]);
}

View File

@ -3,7 +3,7 @@
*
* See the README file for copyright information and how to reach the author.
*
* $Id: setup.h,v 1.18 2008/01/20 16:15:14 rahrenbe Exp $
* $Id: setup.h,v 1.19 2008/01/30 21:57:33 rahrenbe Exp $
*/
#ifndef __IPTV_SETUP_H
@ -20,6 +20,7 @@ private:
int extProtocolBasePort;
int sectionFiltering;
int sidScanning;
int pidScanning;
int numDisabledFilters;
int disabledFilterIndexes[SECTION_FILTER_TABLE_SIZE];
const char *disabledFilterNames[SECTION_FILTER_TABLE_SIZE];

View File

@ -3,7 +3,7 @@
*
* See the README file for copyright information and how to reach the author.
*
* $Id: socket.c,v 1.6 2007/10/26 22:07:10 rahrenbe Exp $
* $Id: socket.c,v 1.7 2008/01/30 21:57:33 rahrenbe Exp $
*/
#include <sys/types.h>
@ -71,7 +71,7 @@ bool cIptvSocket::OpenSocket(const int Port, const bool isUdp)
if (isUdp) {
int err = bind(socketDesc, (struct sockaddr *)&sockAddr, sizeof(sockAddr));
ERROR_IF_FUNC(err < 0, "bind()", CloseSocket(), return false);
}
}
// Update socket port
socketPort = Port;
}
@ -110,9 +110,9 @@ int cIptvUdpSocket::Read(unsigned char* *BufferAddr)
//debug("cIptvUdpSocket::Read()\n");
// Error out if socket not initialized
if (socketDesc <= 0) {
error("ERROR: Invalid socket in %s\n", __FUNCTION__);
return -1;
}
error("ERROR: Invalid socket in %s\n", __FUNCTION__);
return -1;
}
socklen_t addrlen = sizeof(sockAddr);
// Set argument point to read buffer
*BufferAddr = readBuffer;
@ -186,9 +186,9 @@ int cIptvTcpSocket::Read(unsigned char* *BufferAddr)
//debug("cIptvTcpSocket::Read()\n");
// Error out if socket not initialized
if (socketDesc <= 0) {
error("ERROR: Invalid socket in %s\n", __FUNCTION__);
return -1;
}
error("ERROR: Invalid socket in %s\n", __FUNCTION__);
return -1;
}
socklen_t addrlen = sizeof(sockAddr);
// Set argument point to read buffer
*BufferAddr = readBuffer;

View File

@ -3,7 +3,7 @@
*
* See the README file for copyright information and how to reach the author.
*
* $Id: streamer.c,v 1.29 2008/01/19 21:08:03 ajhseppa Exp $
* $Id: streamer.c,v 1.30 2008/01/30 21:57:33 rahrenbe Exp $
*/
#include <vdr/thread.h>
@ -59,9 +59,8 @@ bool cIptvStreamer::Open(void)
{
debug("cIptvStreamer::Open()\n");
// Open the protocol
if (protocol)
if(!protocol->Open())
return false;
if (protocol && !protocol->Open())
return false;
// Start thread
Start();
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.13 2007/10/19 22:18:55 rahrenbe Exp $
* $Id: streamer.h,v 1.14 2008/01/30 21:57:33 rahrenbe Exp $
*/
#ifndef __IPTV_STREAMER_H
@ -36,4 +36,3 @@ public:
};
#endif // __IPTV_STREAMER_H