mirror of
https://github.com/rofafor/vdr-plugin-iptv.git
synced 2023-10-10 13:37:03 +02:00
Fixed remaining lint warnings.
This commit is contained in:
parent
e74d4f88f4
commit
d1c2d48a6b
8
device.c
8
device.c
@ -10,7 +10,7 @@
|
||||
|
||||
#define IPTV_MAX_DEVICES MAXDEVICES
|
||||
|
||||
cIptvDevice * IptvDevices[IPTV_MAX_DEVICES] = { NULL };
|
||||
static cIptvDevice * IptvDevices[IPTV_MAX_DEVICES] = { NULL };
|
||||
|
||||
unsigned int cIptvDevice::deviceCount = 0;
|
||||
|
||||
@ -304,7 +304,7 @@ bool cIptvDevice::DeleteFilter(unsigned int Index)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool cIptvDevice::IsBlackListed(u_short Pid, u_char Tid, u_char Mask)
|
||||
bool cIptvDevice::IsBlackListed(u_short Pid, u_char Tid, u_char Mask) const
|
||||
{
|
||||
//debug("cIptvDevice::IsBlackListed(%d) Pid=%d Tid=%02X Mask=%02X\n", deviceIndex, Pid, Tid, Mask);
|
||||
// loop through section filter table
|
||||
@ -366,7 +366,7 @@ bool cIptvDevice::OpenDvr(void)
|
||||
if (pIptvStreamer)
|
||||
pIptvStreamer->Open();
|
||||
if (sidScanEnabled && pSidScanner && IptvConfig.GetSectionFiltering())
|
||||
pSidScanner->SetStatus(true);
|
||||
pSidScanner->Open();
|
||||
isOpenDvr = true;
|
||||
return true;
|
||||
}
|
||||
@ -375,7 +375,7 @@ void cIptvDevice::CloseDvr(void)
|
||||
{
|
||||
debug("cIptvDevice::CloseDvr(%d)\n", deviceIndex);
|
||||
if (sidScanEnabled && pSidScanner && IptvConfig.GetSectionFiltering())
|
||||
pSidScanner->SetStatus(false);
|
||||
pSidScanner->Close();
|
||||
if (pIptvStreamer)
|
||||
pIptvStreamer->Close();
|
||||
isOpenDvr = false;
|
||||
|
2
device.h
2
device.h
@ -74,7 +74,7 @@ private:
|
||||
void ResetBuffering(void);
|
||||
bool IsBuffering(void);
|
||||
bool DeleteFilter(unsigned int Index);
|
||||
bool IsBlackListed(u_short Pid, u_char Tid, u_char Mask);
|
||||
bool IsBlackListed(u_short Pid, u_char Tid, u_char Mask) const;
|
||||
|
||||
// for channel selection
|
||||
public:
|
||||
|
@ -15,16 +15,6 @@
|
||||
|
||||
class cIptvSectionFilter : public cIptvSectionStatistics {
|
||||
private:
|
||||
enum dmx_success {
|
||||
DMX_OK = 0, // Received OK
|
||||
DMX_LENGTH_ERROR, // Incorrect length
|
||||
DMX_OVERRUN_ERROR, // Receiver ring buffer overrun
|
||||
DMX_CRC_ERROR, // Incorrect CRC
|
||||
DMX_FRAME_ERROR, // Frame alignment error
|
||||
DMX_FIFO_ERROR, // Receiver FIFO overrun
|
||||
DMX_MISSED_ERROR // Receiver missed packet
|
||||
};
|
||||
|
||||
enum dmx_limits {
|
||||
DMX_MAX_FILTER_SIZE = 18,
|
||||
DMX_MAX_SECTION_SIZE = 4096,
|
||||
@ -69,7 +59,7 @@ public:
|
||||
virtual ~cIptvSectionFilter();
|
||||
void Process(const uint8_t* Data);
|
||||
int GetReadDesc(void);
|
||||
uint16_t GetPid(void) { return pid; }
|
||||
uint16_t GetPid(void) const { return pid; }
|
||||
};
|
||||
|
||||
#endif // __IPTV_SECTIONFILTER_H
|
||||
|
10
setup.c
10
setup.c
@ -17,10 +17,6 @@
|
||||
#include "device.h"
|
||||
#include "setup.h"
|
||||
|
||||
#ifndef trVDR
|
||||
#define trVDR(s) tr(s)
|
||||
#endif
|
||||
|
||||
// --- cIptvMenuEditChannel --------------------------------------------------
|
||||
|
||||
class cIptvMenuEditChannel : public cOsdMenu
|
||||
@ -391,7 +387,7 @@ class cIptvMenuChannels : public cOsdMenu
|
||||
{
|
||||
private:
|
||||
void Setup(void);
|
||||
cChannel *GetChannel(int Index);
|
||||
cChannel *GetChannel(int Index) const;
|
||||
void Propagate(void);
|
||||
|
||||
protected:
|
||||
@ -431,7 +427,7 @@ void cIptvMenuChannels::Setup(void)
|
||||
Display();
|
||||
}
|
||||
|
||||
cChannel *cIptvMenuChannels::GetChannel(int Index)
|
||||
cChannel *cIptvMenuChannels::GetChannel(int Index) const
|
||||
{
|
||||
cIptvMenuChannelItem *p = dynamic_cast<cIptvMenuChannelItem *>(Get(Index));
|
||||
return p ? (cChannel *)p->Channel() : NULL;
|
||||
@ -712,7 +708,7 @@ eOSState cIptvPluginSetup::ProcessKey(eKeys Key)
|
||||
case kBlue: return ShowInfo();
|
||||
case kInfo: if (Current() < help.Size())
|
||||
return AddSubMenu(new cMenuText(cString::sprintf("%s - %s '%s'", tr("Help"), trVDR("Plugin"), PLUGIN_NAME_I18N), help[Current()]));
|
||||
default: state = osContinue;
|
||||
default: state = osContinue; break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -17,11 +17,13 @@ private:
|
||||
|
||||
protected:
|
||||
virtual void Process(u_short Pid, u_char Tid, const u_char *Data, int Length);
|
||||
virtual void SetStatus(bool On);
|
||||
|
||||
public:
|
||||
cSidScanner(void);
|
||||
virtual void SetStatus(bool On);
|
||||
void SetChannel(const cChannel *Channel);
|
||||
void Open() { SetStatus(true); }
|
||||
void Close() { SetStatus(false); }
|
||||
};
|
||||
|
||||
#endif // __SIDSCANNER_H
|
||||
|
@ -32,7 +32,7 @@ cString cIptvSectionStatistics::GetSectionStatistic()
|
||||
cMutexLock MutexLock(&mutex);
|
||||
uint64_t elapsed = timer.Elapsed(); /* in milliseconds */
|
||||
timer.Set();
|
||||
long bitrate = elapsed ? (long)((float)1000 / KILOBYTE(1) * filteredData / elapsed) : 0L;
|
||||
long bitrate = elapsed ? (long)(((float)1000 / KILOBYTE(1)) * filteredData / elapsed) : 0L;
|
||||
if (!IptvConfig.GetUseBytes())
|
||||
bitrate *= 8;
|
||||
// no trailing linefeed here!
|
||||
@ -75,7 +75,7 @@ cString cIptvPidStatistics::GetPidStatistic()
|
||||
cString info("Active pids:\n");
|
||||
for (unsigned int i = 0; i < IPTV_STATS_ACTIVE_PIDS_COUNT; ++i) {
|
||||
if (mostActivePids[i].pid) {
|
||||
long bitrate = elapsed ? (long)((float)1000 / KILOBYTE(1) * mostActivePids[i].DataAmount / elapsed) : 0L;
|
||||
long bitrate = elapsed ? (long)(((float)1000 / KILOBYTE(1)) * mostActivePids[i].DataAmount / elapsed) : 0L;
|
||||
if (!IptvConfig.GetUseBytes())
|
||||
bitrate *= 8;
|
||||
info = cString::sprintf("%sPid %d: %4d (%4ld k%s/s)\n", *info, i,
|
||||
@ -145,7 +145,7 @@ cString cIptvStreamerStatistics::GetStreamerStatistic()
|
||||
cMutexLock MutexLock(&mutex);
|
||||
uint64_t elapsed = timer.Elapsed(); /* in milliseconds */
|
||||
timer.Set();
|
||||
long bitrate = elapsed ? (long)((float)1000 / KILOBYTE(1) * dataBytes / elapsed) : 0L;
|
||||
long bitrate = elapsed ? (long)(((float)1000 / KILOBYTE(1)) * dataBytes / elapsed) : 0L;
|
||||
if (!IptvConfig.GetUseBytes())
|
||||
bitrate *= 8;
|
||||
cString info = cString::sprintf("Stream bitrate: %ld k%s/s\n", bitrate, IptvConfig.GetUseBytes() ? "B" : "bit");
|
||||
@ -182,7 +182,7 @@ cString cIptvBufferStatistics::GetBufferStatistic()
|
||||
cMutexLock MutexLock(&mutex);
|
||||
uint64_t elapsed = timer.Elapsed(); /* in milliseconds */
|
||||
timer.Set();
|
||||
long bitrate = elapsed ? (long)((float)1000 / KILOBYTE(1) * dataBytes / elapsed) : 0L;
|
||||
long bitrate = elapsed ? (long)(((float)1000 / KILOBYTE(1)) * dataBytes / elapsed) : 0L;
|
||||
long totalSpace = MEGABYTE(IptvConfig.GetTsBufferSize());
|
||||
float percentage = (float)((float)usedSpace / (float)totalSpace * 100.0);
|
||||
long totalKilos = totalSpace / KILOBYTE(1);
|
||||
|
@ -21,7 +21,7 @@ cIptvStreamer::cIptvStreamer(cRingBufferLinear* RingBuffer, unsigned int PacketL
|
||||
// Allocate packet buffer
|
||||
packetBuffer = MALLOC(unsigned char, packetBufferLen);
|
||||
if (packetBuffer)
|
||||
memset(packetBuffer, 0, packetBufferLen);
|
||||
memset(packetBuffer, 0, packetBufferLen);
|
||||
else
|
||||
error("ERROR: MALLOC() failed for packet buffer");
|
||||
}
|
||||
@ -32,6 +32,7 @@ cIptvStreamer::~cIptvStreamer()
|
||||
// Close the protocol
|
||||
Close();
|
||||
protocol = NULL;
|
||||
ringBuffer = NULL;
|
||||
// Free allocated memory
|
||||
free(packetBuffer);
|
||||
}
|
||||
|
@ -24,10 +24,12 @@ private:
|
||||
unsigned int packetBufferLen;
|
||||
cIptvProtocolIf* protocol;
|
||||
|
||||
protected:
|
||||
virtual void Action(void);
|
||||
|
||||
public:
|
||||
cIptvStreamer(cRingBufferLinear* RingBuffer, unsigned int PacketLen);
|
||||
virtual ~cIptvStreamer();
|
||||
virtual void Action(void);
|
||||
bool Set(const char* Location, const int Parameter, const int Index, cIptvProtocolIf* Protocol);
|
||||
bool Open(void);
|
||||
bool Close(void);
|
||||
|
Loading…
Reference in New Issue
Block a user