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

Fixed channels.conf format used in vlc2iptv. Disabled retuning feature and added some minor corrections.

This commit is contained in:
Rolf Ahrenberg 2008-04-02 22:55:04 +00:00
parent e798ff1424
commit c507f373ff
6 changed files with 29 additions and 22 deletions

View File

@ -61,3 +61,4 @@ VDR Plugin 'iptv' Revision History
- 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.
- Updated vlc2iptv script for new channels.conf format.

View File

@ -3,7 +3,7 @@
*
* See the README file for copyright information and how to reach the author.
*
* $Id: device.c,v 1.86 2008/04/02 20:22:48 rahrenbe Exp $
* $Id: device.c,v 1.87 2008/04/02 22:55:04 rahrenbe Exp $
*/
#include "config.h"
@ -371,7 +371,7 @@ bool cIptvDevice::OpenDvr(void)
void cIptvDevice::CloseDvr(void)
{
debug("cIptvDevice::CloseDvr(%d)\n", deviceIndex);
if (pidScanEnabled && pSidScanner && IptvConfig.GetSectionFiltering())
if (sidScanEnabled && pSidScanner && IptvConfig.GetSectionFiltering())
pSidScanner->SetStatus(false);
if (pIptvStreamer)
pIptvStreamer->Close();

View File

@ -52,7 +52,7 @@ lookup_channel_and_pids()
[ ! -e "$CHANNELS_CONF" ] && \
exit_with_error "channels.conf not found ($CHANNELS_CONF)"
local CHANNEL_RECORD=`grep ":IPTV|EXT|vlc2iptv|$PARAMETER:" $CHANNELS_CONF`
local CHANNEL_RECORD=`grep "[:]IPTV[|][SP][10][SP][10][|]EXT[|]vlc2iptv[|]$PARAMETER[:]" $CHANNELS_CONF`
[ -z "$CHANNEL_RECORD" ] && \
exit_with_error "no iptv channel with parameter $PARAMETER found"

View File

@ -3,14 +3,14 @@
*
* See the README file for copyright information and how to reach the author.
*
* $Id: pidscanner.c,v 1.6 2008/02/02 21:06:14 rahrenbe Exp $
* $Id: pidscanner.c,v 1.7 2008/04/02 22:55:04 rahrenbe Exp $
*/
#include "common.h"
#include "pidscanner.h"
#define PIDSCANNER_TIMEOUT_IN_MS 15000 /* 15s timeout for detection */
#define PIDSCANNER_APID_COUNT 5 /* minimum count of audio pid samples for pid detection */
#define PIDSCANNER_APID_COUNT 10 /* minimum count of audio pid samples for pid detection */
#define PIDSCANNER_VPID_COUNT 10 /* minimum count of video pid samples for pid detection */
#define PIDSCANNER_PID_DELTA_COUNT 50 /* minimum count of pid samples for audio/video only pid detection */
@ -92,29 +92,29 @@ void cPidScanner::Process(const uint8_t* buf)
// Stream ID
if ((sid >= 0xC0) && (sid <= 0xDF)) {
if (pid < Apid) {
debug("Found lower Apid: 0x%X instead of 0x%X\n", pid, Apid);
debug("cPidScanner::Process: Found lower Apid: 0x%X instead of 0x%X\n", pid, Apid);
Apid = pid;
numApids = 1;
}
else if (pid == Apid) {
++numApids;
debug("Incrementing Apids, now at %d\n", numApids);
debug("cPidScanner::Process: Incrementing Apids, now at %d\n", numApids);
}
}
else if ((sid >= 0xE0) && (sid <= 0xEF)) {
if (pid < Vpid) {
debug("Found lower Vpid: 0x%X instead of 0x%X\n", pid, Vpid);
debug("cPidScanner::Process: Found lower Vpid: 0x%X instead of 0x%X\n", pid, Vpid);
Vpid = pid;
numVpids = 1;
}
else if (pid == Vpid) {
++numVpids;
debug("Incrementing Vpids, now at %d\n", numVpids);
debug("cPidScanner::Process: Incrementing Vpids, now at %d\n", numVpids);
}
}
}
if (((numVpids > PIDSCANNER_VPID_COUNT) && (numApids > PIDSCANNER_APID_COUNT)) ||
(abs(numApids - numVpids) > PIDSCANNER_PID_DELTA_COUNT)) {
if (((numVpids >= PIDSCANNER_VPID_COUNT) && (numApids >= PIDSCANNER_APID_COUNT)) ||
(abs(numApids - numVpids) >= PIDSCANNER_PID_DELTA_COUNT)) {
// Lock channels for pid updates
if (!Channels.Lock(true, 10)) {
timeout.Set(PIDSCANNER_TIMEOUT_IN_MS);
@ -130,9 +130,9 @@ void cPidScanner::Process(const uint8_t* buf)
int Ppid = IptvChannel->Ppid();
int Tpid = IptvChannel->Tpid();
bool foundApid = false;
if (numVpids <= PIDSCANNER_VPID_COUNT)
if (numVpids < PIDSCANNER_VPID_COUNT)
Vpid = 0; // No detected video pid
else if (numApids <= PIDSCANNER_APID_COUNT)
else if (numApids < PIDSCANNER_APID_COUNT)
Apid = 0; // No detected audio pid
for (unsigned int i = 1; i < MAXAPIDS; ++i) {
Apids[i] = IptvChannel->Apid(i);

View File

@ -3,7 +3,7 @@
*
* See the README file for copyright information and how to reach the author.
*
* $Id: protocolhttp.c,v 1.24 2008/02/17 19:18:47 rahrenbe Exp $
* $Id: protocolhttp.c,v 1.25 2008/04/02 22:55:04 rahrenbe Exp $
*/
#include <sys/types.h>
@ -34,7 +34,6 @@ cIptvProtocolHttp::~cIptvProtocolHttp()
// Free allocated memory
free(streamPath);
free(streamAddr);
}
bool cIptvProtocolHttp::Connect(void)
@ -237,7 +236,7 @@ bool cIptvProtocolHttp::Set(const char* Location, const int Parameter, const int
else
streamPath = strcpyrealloc(streamPath, "/");
socketPort = Parameter;
debug("http://%s:%d%s\n", streamAddr, socketPort, streamPath);
//debug("http://%s:%d%s\n", streamAddr, socketPort, streamPath);
// Re-connect the socket
Connect();
}

View File

@ -3,7 +3,7 @@
*
* See the README file for copyright information and how to reach the author.
*
* $Id: streamer.c,v 1.31 2008/04/02 20:22:48 rahrenbe Exp $
* $Id: streamer.c,v 1.32 2008/04/02 22:55:04 rahrenbe Exp $
*/
#include <vdr/thread.h>
@ -17,7 +17,7 @@ cIptvStreamer::cIptvStreamer(cRingBufferLinear* RingBuffer, cMutex* Mutex)
ringBuffer(RingBuffer),
mutex(Mutex),
protocol(NULL),
location(NULL),
location(""),
parameter(-1),
index(-1)
{
@ -84,6 +84,11 @@ bool cIptvStreamer::Close(void)
protocol->Close();
if (mutex)
mutex->Unlock();
// reset stream variables
protocol = NULL;
location = cString("");
parameter = -1;
index = -1;
return true;
}
@ -92,9 +97,11 @@ 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;
// Check if (re)tune is needed
//if ((strcmp(*location, Location) == 0) && (parameter == Parameter) && (index == Index) && (protocol == Protocol)) {
// debug("cIptvStreamer::Set(): (Re)tune skipped\n");
// return false;
// }
// Update protocol; Close the existing one if changed
if (protocol != Protocol) {
if (protocol)