Some late night fixes.

This commit is contained in:
Rolf Ahrenberg 2007-09-15 23:58:23 +00:00
parent cb87392299
commit 728e791165
5 changed files with 14 additions and 11 deletions

View File

@ -1,10 +1,10 @@
# #
# Makefile for a Video Disk Recorder plugin # 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 # Debugging on/off
IPTV_DEBUG = 1 #IPTV_DEBUG = 1
# Strip debug symbols? Set eg. to /bin/true if not # Strip debug symbols? Set eg. to /bin/true if not
STRIP = strip STRIP = strip

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.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" #include "common.h"
@ -30,7 +30,7 @@ cIptvDevice::cIptvDevice(unsigned int Index)
tsBufferPrefill = MEGABYTE(IptvConfig.GetBufferSizeMB()) * tsBufferPrefill = MEGABYTE(IptvConfig.GetBufferSizeMB()) *
IptvConfig.GetBufferPrefillRatio() / 100; IptvConfig.GetBufferPrefillRatio() / 100;
tsBufferPrefill -= (tsBufferPrefill % TS_SIZE); 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(); pUdpProtocol = new cIptvProtocolUdp();
//pRtspProtocol = new cIptvProtocolRtsp(); //pRtspProtocol = new cIptvProtocolRtsp();
//pHttpProtocol = new cIptvProtocolHttp(); //pHttpProtocol = new cIptvProtocolHttp();

4
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.3 2007/09/15 15:38:38 rahrenbe Exp $ * $Id: iptv.c,v 1.4 2007/09/15 23:58:23 rahrenbe Exp $
*/ */
#include <getopt.h> #include <getopt.h>
@ -156,6 +156,8 @@ bool cPluginIptv::SetupParse(const char *Name, const char *Value)
// Parse your own setup parameters and store their values. // Parse your own setup parameters and store their values.
if (!strcasecmp(Name, "BufferSize")) if (!strcasecmp(Name, "BufferSize"))
IptvConfig.SetBufferSizeMB(atoi(Value)); IptvConfig.SetBufferSizeMB(atoi(Value));
else if (!strcasecmp(Name, "BufferPrefill"))
IptvConfig.SetBufferPrefillRatio(atoi(Value));
else else
return false; return false;
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: 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 <sys/types.h> #include <sys/types.h>
@ -155,7 +155,8 @@ int cIptvProtocolUdp::Read(unsigned char* *BufferAddr)
{ {
//debug("cIptvProtocolUdp::Read()\n"); //debug("cIptvProtocolUdp::Read()\n");
socklen_t addrlen = sizeof(sockAddr); socklen_t addrlen = sizeof(sockAddr);
BufferAddr = &readBuffer; // Set argument point to read buffer
*BufferAddr = readBuffer;
// Wait for data // Wait for data
struct timeval tv; struct timeval tv;
tv.tv_sec = 0; tv.tv_sec = 0;
@ -182,7 +183,7 @@ int cIptvProtocolUdp::Read(unsigned char* *BufferAddr)
bool cIptvProtocolUdp::Open(void) bool cIptvProtocolUdp::Open(void)
{ {
debug("cIptvProtocolUdp::Open(): streamAddr = %s\n", streamAddr); debug("cIptvProtocolUdp::Open(): streamAddr=%s\n", streamAddr);
// Join a new multicast group // Join a new multicast group
JoinMulticast(); JoinMulticast();
return true; return true;
@ -190,7 +191,7 @@ bool cIptvProtocolUdp::Open(void)
bool cIptvProtocolUdp::Close(void) bool cIptvProtocolUdp::Close(void)
{ {
debug("cIptvProtocolUdp::Close(): streamAddr = %s\n", streamAddr); debug("cIptvProtocolUdp::Close(): streamAddr=%s\n", streamAddr);
// Drop the multicast group // Drop the multicast group
DropMulticast(); DropMulticast();
// Close the socket // Close the socket

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.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" #include "common.h"
@ -21,7 +21,7 @@ void cIptvPluginSetup::Setup(void)
{ {
int current = Current(); int current = Current();
Clear(); 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)); Add(new cMenuEditIntItem(tr("Buffer prefill ratio [%]"), &bufferPrefill, 0, 40));
SetCurrent(Get(current)); SetCurrent(Get(current));
Display(); Display();