1
0
mirror of https://github.com/rofafor/vdr-plugin-iptv.git synced 2023-10-10 11:37:03 +00: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. * 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> #include <vdr/tools.h>
@ -50,9 +50,9 @@ int select_single_desc(int descriptor, const int usecs, const bool selectWrite)
FD_SET(descriptor, &fds); FD_SET(descriptor, &fds);
int retval = 0; int retval = 0;
if (selectWrite) if (selectWrite)
retval = select(descriptor + 1, NULL, &fds, NULL, &tv); retval = select(descriptor + 1, NULL, &fds, NULL, &tv);
else else
retval = select(descriptor + 1, &fds, NULL, NULL, &tv); retval = select(descriptor + 1, &fds, NULL, NULL, &tv);
// Check if error // Check if error
ERROR_IF_RET(retval < 0, "select()", return retval); ERROR_IF_RET(retval < 0, "select()", return retval);
return retval; return retval;

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: 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" #include "config.h"
@ -17,7 +17,8 @@ cIptvConfig::cIptvConfig(void)
extProtocolBasePort(4321), extProtocolBasePort(4321),
useBytes(1), useBytes(1),
sectionFiltering(1), sectionFiltering(1),
sidScanning(1) sidScanning(1),
pidScanning(0)
{ {
for (unsigned int i = 0; i < ARRAY_SIZE(disabledFilters) - 1; ++i) for (unsigned int i = 0; i < ARRAY_SIZE(disabledFilters) - 1; ++i)
disabledFilters[i] = -1; disabledFilters[i] = -1;

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: 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 #ifndef __IPTV_CONFIG_H
@ -22,6 +22,7 @@ private:
unsigned int useBytes; unsigned int useBytes;
unsigned int sectionFiltering; unsigned int sectionFiltering;
unsigned int sidScanning; unsigned int sidScanning;
unsigned int pidScanning;
int disabledFilters[SECTION_FILTER_TABLE_SIZE]; int disabledFilters[SECTION_FILTER_TABLE_SIZE];
char configDirectory[255]; char configDirectory[255];
@ -34,6 +35,7 @@ public:
unsigned int GetUseBytes(void) const { return useBytes; } unsigned int GetUseBytes(void) const { return useBytes; }
unsigned int GetSectionFiltering(void) const { return sectionFiltering; } unsigned int GetSectionFiltering(void) const { return sectionFiltering; }
unsigned int GetSidScanning(void) const { return sidScanning; } unsigned int GetSidScanning(void) const { return sidScanning; }
unsigned int GetPidScanning(void) const { return pidScanning; }
const char *GetConfigDirectory(void) const { return configDirectory; } const char *GetConfigDirectory(void) const { return configDirectory; }
unsigned int GetDisabledFiltersCount(void) const; unsigned int GetDisabledFiltersCount(void) const;
int GetDisabledFilters(unsigned int Index) const; int GetDisabledFilters(unsigned int Index) const;
@ -43,6 +45,7 @@ public:
void SetUseBytes(unsigned int On) { useBytes = On; } void SetUseBytes(unsigned int On) { useBytes = On; }
void SetSectionFiltering(unsigned int On) { sectionFiltering = On; } void SetSectionFiltering(unsigned int On) { sectionFiltering = On; }
void SetSidScanning(unsigned int On) { sidScanning = On; } void SetSidScanning(unsigned int On) { sidScanning = On; }
void SetPidScanning(unsigned int On) { pidScanning = On; }
void SetDisabledFilters(unsigned int Index, int Number); void SetDisabledFilters(unsigned int Index, int Number);
void SetConfigDirectory(const char *directoryP); void SetConfigDirectory(const char *directoryP);
}; };

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.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" #include "config.h"
@ -326,7 +326,7 @@ void cIptvDevice::CloseDvr(void)
if (pSidScanner && IptvConfig.GetSectionFiltering() && IptvConfig.GetSidScanning()) if (pSidScanner && IptvConfig.GetSectionFiltering() && IptvConfig.GetSidScanning())
pSidScanner->SetStatus(false); pSidScanner->SetStatus(false);
if (pIptvStreamer) if (pIptvStreamer)
pIptvStreamer->Close(); pIptvStreamer->Close();
isOpenDvr = false; isOpenDvr = false;
} }

42
iptv.c
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: 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> #include <getopt.h>
@ -79,20 +79,20 @@ bool cPluginIptv::ProcessArgs(int argc, char *argv[])
debug("cPluginIptv::ProcessArgs()\n"); debug("cPluginIptv::ProcessArgs()\n");
// Implement command line argument processing here if applicable. // Implement command line argument processing here if applicable.
static const struct option long_options[] = { static const struct option long_options[] = {
{ "devices", required_argument, NULL, 'd' }, { "devices", required_argument, NULL, 'd' },
{ NULL } { NULL }
}; };
int c; int c;
while ((c = getopt_long(argc, argv, "d:", long_options, NULL)) != -1) { while ((c = getopt_long(argc, argv, "d:", long_options, NULL)) != -1) {
switch (c) { switch (c) {
case 'd': case 'd':
deviceCount = atoi(optarg); deviceCount = atoi(optarg);
break; break;
default: default:
return false; return false;
} }
} }
return true; return true;
} }
@ -167,14 +167,14 @@ int cPluginIptv::ParseFilters(const char *Value, int *Filters)
char buffer[256]; char buffer[256];
int n = 0; int n = 0;
while (Value && *Value && (n < SECTION_FILTER_TABLE_SIZE)) { while (Value && *Value && (n < SECTION_FILTER_TABLE_SIZE)) {
strn0cpy(buffer, Value, sizeof(buffer)); strn0cpy(buffer, Value, sizeof(buffer));
int i = atoi(buffer); int i = atoi(buffer);
//debug("cPluginIptv::ParseFilters(): Filters[%d]=%d\n", n, i); //debug("cPluginIptv::ParseFilters(): Filters[%d]=%d\n", n, i);
if (i >= 0) if (i >= 0)
Filters[n++] = i; Filters[n++] = i;
if ((Value = strchr(Value, ' ')) != NULL) if ((Value = strchr(Value, ' ')) != NULL)
Value++; Value++;
} }
return n; return n;
} }
@ -192,6 +192,8 @@ bool cPluginIptv::SetupParse(const char *Name, const char *Value)
IptvConfig.SetSectionFiltering(atoi(Value)); IptvConfig.SetSectionFiltering(atoi(Value));
else if (!strcasecmp(Name, "SidScanning")) else if (!strcasecmp(Name, "SidScanning"))
IptvConfig.SetSidScanning(atoi(Value)); IptvConfig.SetSidScanning(atoi(Value));
else if (!strcasecmp(Name, "PidScanning"))
IptvConfig.SetPidScanning(atoi(Value));
else if (!strcasecmp(Name, "DisabledFilters")) { else if (!strcasecmp(Name, "DisabledFilters")) {
int DisabledFilters[SECTION_FILTER_TABLE_SIZE]; int DisabledFilters[SECTION_FILTER_TABLE_SIZE];
for (unsigned int i = 0; i < ARRAY_SIZE(DisabledFilters); ++i) for (unsigned int i = 0; i < ARRAY_SIZE(DisabledFilters); ++i)

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: iptv 0.0.6\n" "Project-Id-Version: iptv 0.0.6\n"
"Report-Msgid-Bugs-To: Rolf Ahrenberg\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" "PO-Revision-Date: 2007-10-29 21:19+0100\n"
"Last-Translator: Tobias Grimm <tg@e-tobi.net>\n" "Last-Translator: Tobias Grimm <tg@e-tobi.net>\n"
"Language-Team: German\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." "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 "" 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" msgid "Use section filtering"
msgstr "Benutze Abschnittsfilterung" msgstr "Benutze Abschnittsfilterung"

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: iptv 0.0.6\n" "Project-Id-Version: iptv 0.0.6\n"
"Report-Msgid-Bugs-To: Rolf Ahrenberg\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" "PO-Revision-Date: 2007-08-12 23:22+0300\n"
"Last-Translator: Rolf Ahrenberg\n" "Last-Translator: Rolf Ahrenberg\n"
"Language-Team: <vdr@linuxtv.org>\n" "Language-Team: <vdr@linuxtv.org>\n"
@ -138,6 +138,18 @@ msgstr ""
"\n" "\n"
"Porttiavaruuden koko määräytyy käytettyjen IPTV-laitteiden mukaan. Laajennos lukee EXT-protokollan yhteydessä perusportista dataa, jota ulkoiset ohjelmistot tarjoavat." "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" msgid "Use section filtering"
msgstr "Käytä sektioiden suodatusta" msgstr "Käytä sektioiden suodatusta"
@ -162,7 +174,7 @@ msgid ""
msgstr "" msgstr ""
"Määrittele etsitäänkö palvelutunniste (SID) automaattisesti.\n" "Määrittele etsitäänkö palvelutunniste (SID) automaattisesti.\n"
"\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" msgid "Disable filters"
msgstr "Poista suodattimia käytöstä" msgstr "Poista suodattimia käytöstä"

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: iptv 0.0.6\n" "Project-Id-Version: iptv 0.0.6\n"
"Report-Msgid-Bugs-To: Rolf Ahrenberg\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" "PO-Revision-Date: 2008-01-26 13:14+0100\n"
"Last-Translator: NIVAL Michaël <mnival@club-internet.fr>\n" "Last-Translator: NIVAL Michaël <mnival@club-internet.fr>\n"
"Language-Team: French\n" "Language-Team: French\n"
@ -140,6 +140,15 @@ msgstr ""
"\n" "\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." "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" msgid "Use section filtering"
msgstr "Utiliser le filtrage de section" msgstr "Utiliser le filtrage de section"

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: iptv 0.0.6\n" "Project-Id-Version: iptv 0.0.6\n"
"Report-Msgid-Bugs-To: Rolf Ahrenberg\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" "PO-Revision-Date: 2008-01-13 16:46+0100\n"
"Last-Translator: Gringo <vdr-italian@tiscali.it>\n" "Last-Translator: Gringo <vdr-italian@tiscali.it>\n"
"Language-Team: Italian\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." "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 "" 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" msgid "Use section filtering"
msgstr "Utilizza sezione filtri" msgstr "Utilizza sezione filtri"

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: 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> #include <sys/wait.h>
@ -115,7 +115,7 @@ bool cIptvProtocolExt::Open(void)
debug("cIptvProtocolExt::Open()\n"); debug("cIptvProtocolExt::Open()\n");
// Reject empty script files // Reject empty script files
if (!strlen(scriptFile)) if (!strlen(scriptFile))
return false; return false;
// Create the listening socket // Create the listening socket
OpenSocket(socketPort); OpenSocket(socketPort);
// Execute the external script // Execute the external script

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: 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> #include <sys/types.h>
@ -119,10 +119,10 @@ bool cIptvProtocolHttp::Disconnect(void)
debug("cIptvProtocolHttp::Disconnect()\n"); debug("cIptvProtocolHttp::Disconnect()\n");
// Check that stream address is valid // Check that stream address is valid
if (isActive) { if (isActive) {
// Close the socket // Close the socket
CloseSocket(); CloseSocket();
// Update active flag // Update active flag
isActive = false; isActive = false;
} }
return true; 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); debug("cIptvProtocolHttp::Set(): Location=%s Parameter=%d Index=%d\n", Location, Parameter, Index);
if (!isempty(Location)) { if (!isempty(Location)) {
// Disconnect the current socket // Disconnect the current socket
Disconnect(); Disconnect();
// Update stream address, path and port // Update stream address, path and port
streamAddr = strcpyrealloc(streamAddr, Location); streamAddr = strcpyrealloc(streamAddr, Location);
char *path = strstr(streamAddr, "/"); char *path = strstr(streamAddr, "/");
if (path) { if (path) {
streamPath = strcpyrealloc(streamPath, path); streamPath = strcpyrealloc(streamPath, path);
*path = 0; *path = 0;
} }
else else
streamPath = strcpyrealloc(streamPath, "/"); streamPath = strcpyrealloc(streamPath, "/");
socketPort = Parameter; socketPort = Parameter;
debug("http://%s:%d%s\n", streamAddr, socketPort, streamPath); debug("http://%s:%d%s\n", streamAddr, socketPort, streamPath);
// Re-connect the socket // Re-connect the socket
Connect(); Connect();
} }
return true; return true;
} }

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: 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 #ifndef __IPTV_PROTOCOLIF_H
@ -20,8 +20,8 @@ public:
virtual cString GetInformation(void) = 0; virtual cString GetInformation(void) = 0;
private: private:
cIptvProtocolIf(const cIptvProtocolIf&); cIptvProtocolIf(const cIptvProtocolIf&);
cIptvProtocolIf& operator=(const cIptvProtocolIf&); cIptvProtocolIf& operator=(const cIptvProtocolIf&);
}; };
#endif // __IPTV_PROTOCOLIF_H #endif // __IPTV_PROTOCOLIF_H

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: 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" #include "sectionfilter.h"
@ -38,17 +38,16 @@ cIptvSectionFilter::cIptvSectionFilter(int Index, int devInd,
filter_mask[0] = Mask; filter_mask[0] = Mask;
// Invert the filter // 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; filter_value[i] ^= 0xff;
}
uint8_t mask, mode, local_doneq = 0; uint8_t mask, mode, local_doneq = 0;
for (int i = 0; i < DMX_MAX_FILTER_SIZE; i++) { for (int i = 0; i < DMX_MAX_FILTER_SIZE; ++i) {
mode = filter_mode[i]; mode = filter_mode[i];
mask = filter_mask[i]; mask = filter_mask[i];
maskandmode[i] = mask & mode; maskandmode[i] = mask & mode;
local_doneq |= maskandnotmode[i] = mask & ~mode; local_doneq |= maskandnotmode[i] = mask & ~mode;
} }
doneq = local_doneq ? 1 : 0; doneq = local_doneq ? 1 : 0;
struct stat sb; struct stat sb;
@ -115,8 +114,6 @@ int cIptvSectionFilter::dmxdev_section_callback(const uint8_t *buffer1, size_t b
return 0; return 0;
} }
void cIptvSectionFilter::demux_swfilter_section_new() void cIptvSectionFilter::demux_swfilter_section_new()
{ {
#ifdef DEMUX_SECTION_LOSS_LOG #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", printf("sectionfilter.c section ts padding loss: %d/%d\n",
n, tsfeedp); n, tsfeedp);
printf("sectionfilter.c pad data:"); printf("sectionfilter.c pad data:");
for (i = 0; i < n; i++) for (i = 0; i < n; ++i)
printf(" %02x", secbuf[i]); printf(" %02x", secbuf[i]);
printf("\n"); printf("\n");
} }
@ -146,7 +143,7 @@ int cIptvSectionFilter::demux_swfilter_sectionfilter()
uint8_t neq = 0; uint8_t neq = 0;
int i; 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]; uint8_t local_xor = filter_value[i] ^ secbuf[i];
if (maskandmode[i] & local_xor) { if (maskandmode[i] & local_xor) {
#ifdef DEBUG_PRINTF #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 */ /* to be sure always set secbuf */
secbuf = secbuf_base + secbufp; secbuf = secbuf_base + secbufp;
for (n = 0; secbufp + 2 < limit; n++) { for (n = 0; secbufp + 2 < limit; ++n) {
seclen_local = section_length(secbuf); seclen_local = section_length(secbuf);
if (seclen_local <= 0 || seclen_local > DMX_MAX_SECTION_SIZE || if (seclen_local <= 0 || seclen_local > DMX_MAX_SECTION_SIZE ||
seclen_local + secbufp > limit) 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. * 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> #include <string.h>
@ -257,44 +257,44 @@ eOSState cIptvMenuEditChannel::ProcessKey(eKeys Key)
bool firstIncrement = true; bool firstIncrement = true;
// Search for identical channels as these will be ignored by vdr // Search for identical channels as these will be ignored by vdr
for (cChannel *iteratorChannel = Channels.First(); iteratorChannel; for (cChannel *iteratorChannel = Channels.First(); iteratorChannel;
iteratorChannel = Channels.Next(iteratorChannel)) { iteratorChannel = Channels.Next(iteratorChannel)) {
// This is one of the channels cause the uniquity check to fail // This is one of the channels cause the uniquity check to fail
if (!iteratorChannel->GroupSep() && iteratorChannel != channel if (!iteratorChannel->GroupSep() && iteratorChannel != channel &&
&& iteratorChannel->GetChannelID() == newchannel.GetChannelID()) { iteratorChannel->GetChannelID() == newchannel.GetChannelID()) {
// See if it has unique Plugin param. If yes then increment // See if it has unique Plugin param. If yes then increment
// the corresponding Rid until it is unique // the corresponding Rid until it is unique
if (strcmp(iteratorChannel->PluginParam(), if (strcmp(iteratorChannel->PluginParam(),
newchannel.PluginParam())) { newchannel.PluginParam())) {
// If the channel RID is already at maximum, then fail the // If the channel RID is already at maximum, then fail the
// channel modification // channel modification
if (iteratorChannel->Rid() >= 0x1FFF) { if (iteratorChannel->Rid() >= 0x1FFF) {
debug("Cannot increment RID over maximum value\n"); debug("Cannot increment RID over maximum value\n");
uniquityFailed = true; uniquityFailed = true;
break; break;
} }
debug("Incrementing conflicting channel RID\n"); debug("Incrementing conflicting channel RID\n");
iteratorChannel->SetId(iteratorChannel->Nid(), iteratorChannel->SetId(iteratorChannel->Nid(),
iteratorChannel->Tid(), iteratorChannel->Tid(),
iteratorChannel->Sid(), iteratorChannel->Sid(),
firstIncrement ? firstIncrement ?
0 : iteratorChannel->Rid() + 1); 0 : iteratorChannel->Rid() + 1);
// Try zero Rid:s at first increment. Prevents them from // Try zero Rid:s at first increment. Prevents them from
// creeping slowly towards their maximum value // creeping slowly towards their maximum value
firstIncrement = false; firstIncrement = false;
// Re-set the search and start again // Re-set the search and start again
iteratorChannel = Channels.First(); iteratorChannel = Channels.First();
continue; continue;
// Cannot work around by incrementing rid because channels // Cannot work around by incrementing rid because channels
// are actually copies of each other // are actually copies of each other
} }
else { else {
uniquityFailed = true; uniquityFailed = true;
break; break;
} }
} }
} }
if (!uniquityFailed) { if (!uniquityFailed) {
if (channel) { if (channel) {
SetChannelData(channel); SetChannelData(channel);
@ -623,6 +623,7 @@ cIptvPluginSetup::cIptvPluginSetup()
extProtocolBasePort = IptvConfig.GetExtProtocolBasePort(); extProtocolBasePort = IptvConfig.GetExtProtocolBasePort();
sectionFiltering = IptvConfig.GetSectionFiltering(); sectionFiltering = IptvConfig.GetSectionFiltering();
sidScanning = IptvConfig.GetSidScanning(); sidScanning = IptvConfig.GetSidScanning();
pidScanning = IptvConfig.GetPidScanning();
numDisabledFilters = IptvConfig.GetDisabledFiltersCount(); numDisabledFilters = IptvConfig.GetDisabledFiltersCount();
if (numDisabledFilters > SECTION_FILTER_TABLE_SIZE) if (numDisabledFilters > SECTION_FILTER_TABLE_SIZE)
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.")); 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 #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)); Add(new cMenuEditBoolItem(tr("Use section filtering"), &sectionFiltering));
#if defined(APIVERSNUM) && APIVERSNUM >= 10513 #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.")); 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("ExtProtocolBasePort", extProtocolBasePort);
SetupStore("SectionFiltering", sectionFiltering); SetupStore("SectionFiltering", sectionFiltering);
SetupStore("SidScanning", sidScanning); SetupStore("SidScanning", sidScanning);
SetupStore("PidScanning", pidScanning);
StoreFilters("DisabledFilters", disabledFilterIndexes); StoreFilters("DisabledFilters", disabledFilterIndexes);
// Update global config // Update global config
IptvConfig.SetTsBufferSize(tsBufferSize); IptvConfig.SetTsBufferSize(tsBufferSize);
@ -764,6 +771,7 @@ void cIptvPluginSetup::Store(void)
IptvConfig.SetExtProtocolBasePort(extProtocolBasePort); IptvConfig.SetExtProtocolBasePort(extProtocolBasePort);
IptvConfig.SetSectionFiltering(sectionFiltering); IptvConfig.SetSectionFiltering(sectionFiltering);
IptvConfig.SetSidScanning(sidScanning); IptvConfig.SetSidScanning(sidScanning);
IptvConfig.SetPidScanning(pidScanning);
for (int i = 0; i < SECTION_FILTER_TABLE_SIZE; ++i) for (int i = 0; i < SECTION_FILTER_TABLE_SIZE; ++i)
IptvConfig.SetDisabledFilters(i, disabledFilterIndexes[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. * 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 #ifndef __IPTV_SETUP_H
@ -20,6 +20,7 @@ private:
int extProtocolBasePort; int extProtocolBasePort;
int sectionFiltering; int sectionFiltering;
int sidScanning; int sidScanning;
int pidScanning;
int numDisabledFilters; int numDisabledFilters;
int disabledFilterIndexes[SECTION_FILTER_TABLE_SIZE]; int disabledFilterIndexes[SECTION_FILTER_TABLE_SIZE];
const char *disabledFilterNames[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. * 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> #include <sys/types.h>
@ -71,7 +71,7 @@ bool cIptvSocket::OpenSocket(const int Port, const bool isUdp)
if (isUdp) { if (isUdp) {
int err = bind(socketDesc, (struct sockaddr *)&sockAddr, sizeof(sockAddr)); int err = bind(socketDesc, (struct sockaddr *)&sockAddr, sizeof(sockAddr));
ERROR_IF_FUNC(err < 0, "bind()", CloseSocket(), return false); ERROR_IF_FUNC(err < 0, "bind()", CloseSocket(), return false);
} }
// Update socket port // Update socket port
socketPort = Port; socketPort = Port;
} }
@ -110,9 +110,9 @@ int cIptvUdpSocket::Read(unsigned char* *BufferAddr)
//debug("cIptvUdpSocket::Read()\n"); //debug("cIptvUdpSocket::Read()\n");
// Error out if socket not initialized // Error out if socket not initialized
if (socketDesc <= 0) { if (socketDesc <= 0) {
error("ERROR: Invalid socket in %s\n", __FUNCTION__); error("ERROR: Invalid socket in %s\n", __FUNCTION__);
return -1; return -1;
} }
socklen_t addrlen = sizeof(sockAddr); socklen_t addrlen = sizeof(sockAddr);
// Set argument point to read buffer // Set argument point to read buffer
*BufferAddr = readBuffer; *BufferAddr = readBuffer;
@ -186,9 +186,9 @@ int cIptvTcpSocket::Read(unsigned char* *BufferAddr)
//debug("cIptvTcpSocket::Read()\n"); //debug("cIptvTcpSocket::Read()\n");
// Error out if socket not initialized // Error out if socket not initialized
if (socketDesc <= 0) { if (socketDesc <= 0) {
error("ERROR: Invalid socket in %s\n", __FUNCTION__); error("ERROR: Invalid socket in %s\n", __FUNCTION__);
return -1; return -1;
} }
socklen_t addrlen = sizeof(sockAddr); socklen_t addrlen = sizeof(sockAddr);
// Set argument point to read buffer // Set argument point to read buffer
*BufferAddr = readBuffer; *BufferAddr = readBuffer;

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: 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> #include <vdr/thread.h>
@ -59,9 +59,8 @@ bool cIptvStreamer::Open(void)
{ {
debug("cIptvStreamer::Open()\n"); debug("cIptvStreamer::Open()\n");
// Open the protocol // Open the protocol
if (protocol) if (protocol && !protocol->Open())
if(!protocol->Open()) return false;
return false;
// Start thread // Start thread
Start(); Start();
return true; return true;

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: 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 #ifndef __IPTV_STREAMER_H
@ -36,4 +36,3 @@ public:
}; };
#endif // __IPTV_STREAMER_H #endif // __IPTV_STREAMER_H