From 728e791165313fa97b894d4525fc49489dc690b7 Mon Sep 17 00:00:00 2001 From: Rolf Ahrenberg Date: Sat, 15 Sep 2007 23:58:23 +0000 Subject: [PATCH] Some late night fixes. --- Makefile | 4 ++-- device.c | 4 ++-- iptv.c | 4 +++- protocoludp.c | 9 +++++---- setup.c | 4 ++-- 5 files changed, 14 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index a4b12ce..72086a3 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,10 @@ # # Makefile for a Video Disk Recorder plugin # -# $Id: Makefile,v 1.3 2007/09/15 15:38:38 rahrenbe Exp $ +# $Id: Makefile,v 1.4 2007/09/15 23:58:23 rahrenbe Exp $ # Debugging on/off -IPTV_DEBUG = 1 +#IPTV_DEBUG = 1 # Strip debug symbols? Set eg. to /bin/true if not STRIP = strip diff --git a/device.c b/device.c index 671d8f5..7a19e6c 100644 --- a/device.c +++ b/device.c @@ -3,7 +3,7 @@ * * See the README file for copyright information and how to reach the author. * - * $Id: device.c,v 1.15 2007/09/15 21:27:00 rahrenbe Exp $ + * $Id: device.c,v 1.16 2007/09/15 23:58:23 rahrenbe Exp $ */ #include "common.h" @@ -30,7 +30,7 @@ cIptvDevice::cIptvDevice(unsigned int Index) tsBufferPrefill = MEGABYTE(IptvConfig.GetBufferSizeMB()) * IptvConfig.GetBufferPrefillRatio() / 100; tsBufferPrefill -= (tsBufferPrefill % TS_SIZE); - //debug("Buffer=%dMB Prefill=%B\n", IptvConfig.GetBufferSizeMB(), tsBufferPrefill); + //debug("Buffer=%d Prefill=%d\n", MEGABYTE(IptvConfig.GetBufferSizeMB()), tsBufferPrefill); pUdpProtocol = new cIptvProtocolUdp(); //pRtspProtocol = new cIptvProtocolRtsp(); //pHttpProtocol = new cIptvProtocolHttp(); diff --git a/iptv.c b/iptv.c index ebbe713..4d6b449 100644 --- a/iptv.c +++ b/iptv.c @@ -3,7 +3,7 @@ * * See the README file for copyright information and how to reach the author. * - * $Id: iptv.c,v 1.3 2007/09/15 15:38:38 rahrenbe Exp $ + * $Id: iptv.c,v 1.4 2007/09/15 23:58:23 rahrenbe Exp $ */ #include @@ -156,6 +156,8 @@ bool cPluginIptv::SetupParse(const char *Name, const char *Value) // Parse your own setup parameters and store their values. if (!strcasecmp(Name, "BufferSize")) IptvConfig.SetBufferSizeMB(atoi(Value)); + else if (!strcasecmp(Name, "BufferPrefill")) + IptvConfig.SetBufferPrefillRatio(atoi(Value)); else return false; return true; diff --git a/protocoludp.c b/protocoludp.c index 33322a1..2494fdd 100644 --- a/protocoludp.c +++ b/protocoludp.c @@ -3,7 +3,7 @@ * * See the README file for copyright information and how to reach the author. * - * $Id: protocoludp.c,v 1.3 2007/09/15 21:27:00 rahrenbe Exp $ + * $Id: protocoludp.c,v 1.4 2007/09/15 23:58:23 rahrenbe Exp $ */ #include @@ -155,7 +155,8 @@ int cIptvProtocolUdp::Read(unsigned char* *BufferAddr) { //debug("cIptvProtocolUdp::Read()\n"); socklen_t addrlen = sizeof(sockAddr); - BufferAddr = &readBuffer; + // Set argument point to read buffer + *BufferAddr = readBuffer; // Wait for data struct timeval tv; tv.tv_sec = 0; @@ -182,7 +183,7 @@ int cIptvProtocolUdp::Read(unsigned char* *BufferAddr) bool cIptvProtocolUdp::Open(void) { - debug("cIptvProtocolUdp::Open(): streamAddr = %s\n", streamAddr); + debug("cIptvProtocolUdp::Open(): streamAddr=%s\n", streamAddr); // Join a new multicast group JoinMulticast(); return true; @@ -190,7 +191,7 @@ bool cIptvProtocolUdp::Open(void) bool cIptvProtocolUdp::Close(void) { - debug("cIptvProtocolUdp::Close(): streamAddr = %s\n", streamAddr); + debug("cIptvProtocolUdp::Close(): streamAddr=%s\n", streamAddr); // Drop the multicast group DropMulticast(); // Close the socket diff --git a/setup.c b/setup.c index 976abe4..0da183f 100644 --- a/setup.c +++ b/setup.c @@ -3,7 +3,7 @@ * * See the README file for copyright information and how to reach the author. * - * $Id: setup.c,v 1.2 2007/09/15 21:27:00 rahrenbe Exp $ + * $Id: setup.c,v 1.3 2007/09/15 23:58:23 rahrenbe Exp $ */ #include "common.h" @@ -21,7 +21,7 @@ void cIptvPluginSetup::Setup(void) { int current = Current(); Clear(); - Add(new cMenuEditIntItem(tr("Buffer size [MB]"), &bufferSize, 0, 16)); + Add(new cMenuEditIntItem(tr("Buffer size [MB]"), &bufferSize, 2, 16)); Add(new cMenuEditIntItem(tr("Buffer prefill ratio [%]"), &bufferPrefill, 0, 40)); SetCurrent(Get(current)); Display();