mirror of
https://github.com/rofafor/vdr-plugin-iptv.git
synced 2023-10-10 13:37:03 +02:00
Added 'Show statistics in' option.
This commit is contained in:
parent
78c7d9dfe4
commit
a4ba034795
3
README
3
README
@ -50,6 +50,9 @@ Setup parameters:
|
|||||||
stream ringbuffer before data is
|
stream ringbuffer before data is
|
||||||
transferred to VDR.
|
transferred to VDR.
|
||||||
The valid range: 0...40
|
The valid range: 0...40
|
||||||
|
- Show statistics in = 0 Defines unit (bytes, kbytes, bits, kbits)
|
||||||
|
used in statistics menu.
|
||||||
|
The valid range: 0...3
|
||||||
- Use section filtering = 1 Defines whether section filtering shall
|
- Use section filtering = 1 Defines whether section filtering shall
|
||||||
be used.
|
be used.
|
||||||
The valid range: 0...1
|
The valid range: 0...1
|
||||||
|
8
common.h
8
common.h
@ -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.h,v 1.4 2007/10/06 00:02:50 rahrenbe Exp $
|
* $Id: common.h,v 1.5 2007/10/07 20:08:44 rahrenbe Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __IPTV_COMMON_H
|
#ifndef __IPTV_COMMON_H
|
||||||
@ -22,6 +22,12 @@ uint8_t payload(const uint8_t *tsp);
|
|||||||
#define error(x...) esyslog("IPTV: " x);
|
#define error(x...) esyslog("IPTV: " x);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define IPTV_STATS_UNIT_IN_BYTES 0
|
||||||
|
#define IPTV_STATS_UNIT_IN_KBYTES 1
|
||||||
|
#define IPTV_STATS_UNIT_IN_BITS 2
|
||||||
|
#define IPTV_STATS_UNIT_IN_KBITS 3
|
||||||
|
#define IPTV_STATS_UNIT_COUNT 4
|
||||||
|
|
||||||
#define SECTION_FILTER_TABLE_SIZE 7
|
#define SECTION_FILTER_TABLE_SIZE 7
|
||||||
|
|
||||||
typedef struct _section_filter_table_type {
|
typedef struct _section_filter_table_type {
|
||||||
|
8
config.c
8
config.c
@ -3,10 +3,9 @@
|
|||||||
*
|
*
|
||||||
* 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.13 2007/10/07 19:06:33 ajhseppa Exp $
|
* $Id: config.c,v 1.14 2007/10/07 20:08:44 rahrenbe Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "common.h"
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
cIptvConfig IptvConfig;
|
cIptvConfig IptvConfig;
|
||||||
@ -15,10 +14,9 @@ cIptvConfig::cIptvConfig(void)
|
|||||||
: readBufferTsCount(48),
|
: readBufferTsCount(48),
|
||||||
tsBufferSize(2),
|
tsBufferSize(2),
|
||||||
tsBufferPrefillRatio(0),
|
tsBufferPrefillRatio(0),
|
||||||
|
statsUnit(IPTV_STATS_UNIT_IN_KBYTES),
|
||||||
sectionFiltering(1),
|
sectionFiltering(1),
|
||||||
sidScanning(1),
|
sidScanning(1)
|
||||||
statsInKilos(1),
|
|
||||||
statsInBytes(1)
|
|
||||||
{
|
{
|
||||||
for (unsigned int i = 0; i < sizeof(disabledFilters); ++i)
|
for (unsigned int i = 0; i < sizeof(disabledFilters); ++i)
|
||||||
disabledFilters[i] = -1;
|
disabledFilters[i] = -1;
|
||||||
|
16
config.h
16
config.h
@ -3,13 +3,14 @@
|
|||||||
*
|
*
|
||||||
* 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.11 2007/10/07 19:06:33 ajhseppa Exp $
|
* $Id: config.h,v 1.12 2007/10/07 20:08:44 rahrenbe Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __IPTV_CONFIG_H
|
#ifndef __IPTV_CONFIG_H
|
||||||
#define __IPTV_CONFIG_H
|
#define __IPTV_CONFIG_H
|
||||||
|
|
||||||
#include <vdr/menuitems.h>
|
#include <vdr/menuitems.h>
|
||||||
|
#include "common.h"
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
class cIptvConfig
|
class cIptvConfig
|
||||||
@ -18,10 +19,9 @@ protected:
|
|||||||
unsigned int readBufferTsCount;
|
unsigned int readBufferTsCount;
|
||||||
unsigned int tsBufferSize;
|
unsigned int tsBufferSize;
|
||||||
unsigned int tsBufferPrefillRatio;
|
unsigned int tsBufferPrefillRatio;
|
||||||
|
unsigned int statsUnit;
|
||||||
unsigned int sectionFiltering;
|
unsigned int sectionFiltering;
|
||||||
unsigned int sidScanning;
|
unsigned int sidScanning;
|
||||||
unsigned int statsInKilos;
|
|
||||||
unsigned int statsInBytes;
|
|
||||||
int disabledFilters[SECTION_FILTER_TABLE_SIZE];
|
int disabledFilters[SECTION_FILTER_TABLE_SIZE];
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -29,18 +29,20 @@ public:
|
|||||||
unsigned int GetReadBufferTsCount(void) { return readBufferTsCount; }
|
unsigned int GetReadBufferTsCount(void) { return readBufferTsCount; }
|
||||||
unsigned int GetTsBufferSize(void) { return tsBufferSize; }
|
unsigned int GetTsBufferSize(void) { return tsBufferSize; }
|
||||||
unsigned int GetTsBufferPrefillRatio(void) { return tsBufferPrefillRatio; }
|
unsigned int GetTsBufferPrefillRatio(void) { return tsBufferPrefillRatio; }
|
||||||
|
unsigned int GetStatsUnit(void) { return statsUnit; }
|
||||||
|
unsigned int IsStatsUnitInBytes(void) { return ((statsUnit == IPTV_STATS_UNIT_IN_BYTES) ||
|
||||||
|
(statsUnit == IPTV_STATS_UNIT_IN_KBYTES)); }
|
||||||
|
unsigned int IsStatsUnitInKilos(void) { return ((statsUnit == IPTV_STATS_UNIT_IN_KBYTES) ||
|
||||||
|
(statsUnit == IPTV_STATS_UNIT_IN_KBITS)); }
|
||||||
unsigned int GetSectionFiltering(void) { return sectionFiltering; }
|
unsigned int GetSectionFiltering(void) { return sectionFiltering; }
|
||||||
unsigned int GetSidScanning(void) { return sidScanning; }
|
unsigned int GetSidScanning(void) { return sidScanning; }
|
||||||
unsigned int GetStatsInBytes(void) { return statsInBytes; }
|
|
||||||
unsigned int GetStatsInKilos(void) { return statsInKilos; }
|
|
||||||
unsigned int GetDisabledFiltersCount(void);
|
unsigned int GetDisabledFiltersCount(void);
|
||||||
int GetDisabledFilters(unsigned int Index);
|
int GetDisabledFilters(unsigned int Index);
|
||||||
void SetTsBufferSize(unsigned int Size) { tsBufferSize = Size; }
|
void SetTsBufferSize(unsigned int Size) { tsBufferSize = Size; }
|
||||||
void SetTsBufferPrefillRatio(unsigned int Ratio) { tsBufferPrefillRatio = Ratio; }
|
void SetTsBufferPrefillRatio(unsigned int Ratio) { tsBufferPrefillRatio = Ratio; }
|
||||||
|
void SetStatsUnit(unsigned int Unit) { statsUnit = Unit; }
|
||||||
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 SetStatsInBytes(unsigned int On) { statsInBytes = On; }
|
|
||||||
void SetStatsInKilos(unsigned int On) { statsInKilos = On; }
|
|
||||||
void SetDisabledFilters(unsigned int Index, int Number);
|
void SetDisabledFilters(unsigned int Index, int Number);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
4
iptv.c
4
iptv.c
@ -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.13 2007/10/07 19:06:33 ajhseppa Exp $
|
* $Id: iptv.c,v 1.14 2007/10/07 20:08:44 rahrenbe Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <getopt.h>
|
#include <getopt.h>
|
||||||
@ -175,6 +175,8 @@ bool cPluginIptv::SetupParse(const char *Name, const char *Value)
|
|||||||
IptvConfig.SetTsBufferSize(atoi(Value));
|
IptvConfig.SetTsBufferSize(atoi(Value));
|
||||||
else if (!strcasecmp(Name, "TsBufferPrefill"))
|
else if (!strcasecmp(Name, "TsBufferPrefill"))
|
||||||
IptvConfig.SetTsBufferPrefillRatio(atoi(Value));
|
IptvConfig.SetTsBufferPrefillRatio(atoi(Value));
|
||||||
|
else if (!strcasecmp(Name, "StatsUnit"))
|
||||||
|
IptvConfig.SetStatsUnit(atoi(Value));
|
||||||
else if (!strcasecmp(Name, "SectionFiltering"))
|
else if (!strcasecmp(Name, "SectionFiltering"))
|
||||||
IptvConfig.SetSectionFiltering(atoi(Value));
|
IptvConfig.SetSectionFiltering(atoi(Value));
|
||||||
else if (!strcasecmp(Name, "SidScanning"))
|
else if (!strcasecmp(Name, "SidScanning"))
|
||||||
|
34
po/fi_FI.po
34
po/fi_FI.po
@ -7,7 +7,7 @@ msgid ""
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: VDR 1.5.7\n"
|
"Project-Id-Version: VDR 1.5.7\n"
|
||||||
"Report-Msgid-Bugs-To: Rolf Ahrenberg\n"
|
"Report-Msgid-Bugs-To: Rolf Ahrenberg\n"
|
||||||
"POT-Creation-Date: 2007-10-07 01:11+0300\n"
|
"POT-Creation-Date: 2007-10-07 22:51+0300\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"
|
||||||
@ -95,27 +95,47 @@ msgstr "IPTV-tiedot"
|
|||||||
msgid "IPTV information not available!"
|
msgid "IPTV information not available!"
|
||||||
msgstr "IPTV-tietoja ei saatavilla!"
|
msgstr "IPTV-tietoja ei saatavilla!"
|
||||||
|
|
||||||
#: setup.c:574
|
#: setup.c:560
|
||||||
|
msgid "bytes"
|
||||||
|
msgstr "tavuina"
|
||||||
|
|
||||||
|
#: setup.c:561
|
||||||
|
msgid "kbytes"
|
||||||
|
msgstr "kilotavuina"
|
||||||
|
|
||||||
|
#: setup.c:562
|
||||||
|
msgid "bits"
|
||||||
|
msgstr "bitteinä"
|
||||||
|
|
||||||
|
#: setup.c:563
|
||||||
|
msgid "kbits"
|
||||||
|
msgstr "kilobitteinä"
|
||||||
|
|
||||||
|
#: setup.c:581
|
||||||
msgid "TS buffer size [MB]"
|
msgid "TS buffer size [MB]"
|
||||||
msgstr "TS-puskurin koko [MB]"
|
msgstr "TS-puskurin koko [MB]"
|
||||||
|
|
||||||
#: setup.c:575
|
#: setup.c:582
|
||||||
msgid "TS buffer prefill ratio [%]"
|
msgid "TS buffer prefill ratio [%]"
|
||||||
msgstr "TS-puskurin esitäyttöaste [%]"
|
msgstr "TS-puskurin esitäyttöaste [%]"
|
||||||
|
|
||||||
#: setup.c:576
|
#: setup.c:583
|
||||||
|
msgid "Show statistics in"
|
||||||
|
msgstr "Näytä tilastotiedot"
|
||||||
|
|
||||||
|
#: setup.c:584
|
||||||
msgid "Use section filtering"
|
msgid "Use section filtering"
|
||||||
msgstr "Käytä sektioiden suodatusta"
|
msgstr "Käytä sektioiden suodatusta"
|
||||||
|
|
||||||
#: setup.c:578
|
#: setup.c:586
|
||||||
msgid "Scan Sid automatically"
|
msgid "Scan Sid automatically"
|
||||||
msgstr "Etsi palvelu-ID automaattisesti"
|
msgstr "Etsi palvelu-ID automaattisesti"
|
||||||
|
|
||||||
#: setup.c:579
|
#: setup.c:587
|
||||||
msgid "Disable filters"
|
msgid "Disable filters"
|
||||||
msgstr "Poista suodattimia käytöstä"
|
msgstr "Poista suodattimia käytöstä"
|
||||||
|
|
||||||
#. TRANSLATORS: note the singular!
|
#. TRANSLATORS: note the singular!
|
||||||
#: setup.c:582
|
#: setup.c:590
|
||||||
msgid "Disable filter"
|
msgid "Disable filter"
|
||||||
msgstr "Poista suodatin käytöstä"
|
msgstr "Poista suodatin käytöstä"
|
||||||
|
20
setup.c
20
setup.c
@ -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.25 2007/10/07 19:06:33 ajhseppa Exp $
|
* $Id: setup.c,v 1.26 2007/10/07 20:08:44 rahrenbe Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@ -554,6 +554,13 @@ cIptvPluginSetup::cIptvPluginSetup()
|
|||||||
debug("cIptvPluginSetup::cIptvPluginSetup()\n");
|
debug("cIptvPluginSetup::cIptvPluginSetup()\n");
|
||||||
tsBufferSize = IptvConfig.GetTsBufferSize();
|
tsBufferSize = IptvConfig.GetTsBufferSize();
|
||||||
tsBufferPrefill = IptvConfig.GetTsBufferPrefillRatio();
|
tsBufferPrefill = IptvConfig.GetTsBufferPrefillRatio();
|
||||||
|
statsUnit = IptvConfig.GetStatsUnit();
|
||||||
|
if (statsUnit > IPTV_STATS_UNIT_COUNT)
|
||||||
|
statsUnit = IPTV_STATS_UNIT_IN_BYTES;
|
||||||
|
statsUnitNames[IPTV_STATS_UNIT_IN_BYTES] = tr("bytes");
|
||||||
|
statsUnitNames[IPTV_STATS_UNIT_IN_KBYTES] = tr("kbytes");
|
||||||
|
statsUnitNames[IPTV_STATS_UNIT_IN_BITS] = tr("bits");
|
||||||
|
statsUnitNames[IPTV_STATS_UNIT_IN_KBITS] = tr("kbits");
|
||||||
sectionFiltering = IptvConfig.GetSectionFiltering();
|
sectionFiltering = IptvConfig.GetSectionFiltering();
|
||||||
sidScanning = IptvConfig.GetSidScanning();
|
sidScanning = IptvConfig.GetSidScanning();
|
||||||
numDisabledFilters = IptvConfig.GetDisabledFiltersCount();
|
numDisabledFilters = IptvConfig.GetDisabledFiltersCount();
|
||||||
@ -563,8 +570,6 @@ cIptvPluginSetup::cIptvPluginSetup()
|
|||||||
disabledFilterIndexes[i] = IptvConfig.GetDisabledFilters(i);
|
disabledFilterIndexes[i] = IptvConfig.GetDisabledFilters(i);
|
||||||
disabledFilterNames[i] = tr(section_filter_table[i].description);
|
disabledFilterNames[i] = tr(section_filter_table[i].description);
|
||||||
}
|
}
|
||||||
statsInKilos = IptvConfig.GetStatsInKilos();
|
|
||||||
statsInBytes = IptvConfig.GetStatsInBytes();
|
|
||||||
Setup();
|
Setup();
|
||||||
SetHelp(trVDR("Channels"), NULL, NULL, trVDR("Button$Info"));
|
SetHelp(trVDR("Channels"), NULL, NULL, trVDR("Button$Info"));
|
||||||
}
|
}
|
||||||
@ -575,6 +580,7 @@ void cIptvPluginSetup::Setup(void)
|
|||||||
Clear();
|
Clear();
|
||||||
Add(new cMenuEditIntItem( tr("TS buffer size [MB]"), &tsBufferSize, 2, 16));
|
Add(new cMenuEditIntItem( tr("TS buffer size [MB]"), &tsBufferSize, 2, 16));
|
||||||
Add(new cMenuEditIntItem( tr("TS buffer prefill ratio [%]"), &tsBufferPrefill, 0, 40));
|
Add(new cMenuEditIntItem( tr("TS buffer prefill ratio [%]"), &tsBufferPrefill, 0, 40));
|
||||||
|
Add(new cMenuEditStraItem(tr("Show statistics in"), &statsUnit, IPTV_STATS_UNIT_COUNT, statsUnitNames));
|
||||||
Add(new cMenuEditBoolItem(tr("Use section filtering"), §ionFiltering));
|
Add(new cMenuEditBoolItem(tr("Use section filtering"), §ionFiltering));
|
||||||
if (sectionFiltering) {
|
if (sectionFiltering) {
|
||||||
Add(new cMenuEditBoolItem(tr("Scan Sid automatically"), &sidScanning));
|
Add(new cMenuEditBoolItem(tr("Scan Sid automatically"), &sidScanning));
|
||||||
@ -584,8 +590,6 @@ void cIptvPluginSetup::Setup(void)
|
|||||||
Add(new cMenuEditStraItem(tr("Disable filter"), &disabledFilterIndexes[i], SECTION_FILTER_TABLE_SIZE, disabledFilterNames));
|
Add(new cMenuEditStraItem(tr("Disable filter"), &disabledFilterIndexes[i], SECTION_FILTER_TABLE_SIZE, disabledFilterNames));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Add(new cMenuEditBoolItem(tr("Show statistics in Kilos"), &statsInKilos));
|
|
||||||
Add(new cMenuEditBoolItem(tr("Show statistics in Bytes"), &statsInBytes));
|
|
||||||
SetCurrent(Get(current));
|
SetCurrent(Get(current));
|
||||||
Display();
|
Display();
|
||||||
}
|
}
|
||||||
@ -650,18 +654,16 @@ void cIptvPluginSetup::Store(void)
|
|||||||
// Store values into setup.conf
|
// Store values into setup.conf
|
||||||
SetupStore("TsBufferSize", tsBufferSize);
|
SetupStore("TsBufferSize", tsBufferSize);
|
||||||
SetupStore("TsBufferPrefill", tsBufferPrefill);
|
SetupStore("TsBufferPrefill", tsBufferPrefill);
|
||||||
|
SetupStore("StatsUnit", statsUnit);
|
||||||
SetupStore("SectionFiltering", sectionFiltering);
|
SetupStore("SectionFiltering", sectionFiltering);
|
||||||
SetupStore("SidScanning", sidScanning);
|
SetupStore("SidScanning", sidScanning);
|
||||||
SetupStore("StatsInKilos", statsInKilos);
|
|
||||||
SetupStore("StatsInBytes", statsInBytes);
|
|
||||||
StoreFilters("DisabledFilters", disabledFilterIndexes);
|
StoreFilters("DisabledFilters", disabledFilterIndexes);
|
||||||
// Update global config
|
// Update global config
|
||||||
IptvConfig.SetTsBufferSize(tsBufferSize);
|
IptvConfig.SetTsBufferSize(tsBufferSize);
|
||||||
IptvConfig.SetTsBufferPrefillRatio(tsBufferPrefill);
|
IptvConfig.SetTsBufferPrefillRatio(tsBufferPrefill);
|
||||||
|
IptvConfig.SetStatsUnit(statsUnit);
|
||||||
IptvConfig.SetSectionFiltering(sectionFiltering);
|
IptvConfig.SetSectionFiltering(sectionFiltering);
|
||||||
IptvConfig.SetSidScanning(sidScanning);
|
IptvConfig.SetSidScanning(sidScanning);
|
||||||
IptvConfig.SetStatsInKilos(statsInKilos);
|
|
||||||
IptvConfig.SetStatsInBytes(statsInBytes);
|
|
||||||
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]);
|
||||||
}
|
}
|
||||||
|
6
setup.h
6
setup.h
@ -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.12 2007/10/07 19:06:33 ajhseppa Exp $
|
* $Id: setup.h,v 1.13 2007/10/07 20:08:45 rahrenbe Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __IPTV_SETUP_H
|
#ifndef __IPTV_SETUP_H
|
||||||
@ -19,8 +19,8 @@ private:
|
|||||||
int tsBufferPrefill;
|
int tsBufferPrefill;
|
||||||
int sectionFiltering;
|
int sectionFiltering;
|
||||||
int sidScanning;
|
int sidScanning;
|
||||||
int statsInKilos;
|
int statsUnit;
|
||||||
int statsInBytes;
|
const char *statsUnitNames[IPTV_STATS_UNIT_COUNT];
|
||||||
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];
|
||||||
|
14
statistics.c
14
statistics.c
@ -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: statistics.c,v 1.8 2007/10/07 19:29:09 ajhseppa Exp $
|
* $Id: statistics.c,v 1.9 2007/10/07 20:08:45 rahrenbe Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
@ -35,11 +35,11 @@ cString cIptvSectionStatistics::GetStatistic()
|
|||||||
elapsed ? : elapsed = 1;
|
elapsed ? : elapsed = 1;
|
||||||
float divider = elapsed / 1000;
|
float divider = elapsed / 1000;
|
||||||
char unit[] = { ' ', 'B', '/', 's', '\0' };
|
char unit[] = { ' ', 'B', '/', 's', '\0' };
|
||||||
if (IptvConfig.GetStatsInKilos()) {
|
if (IptvConfig.IsStatsUnitInKilos()) {
|
||||||
divider *= KILOBYTE(1);
|
divider *= KILOBYTE(1);
|
||||||
unit[0] = 'k';
|
unit[0] = 'k';
|
||||||
}
|
}
|
||||||
if (!IptvConfig.GetStatsInBytes()) {
|
if (!IptvConfig.IsStatsUnitInBytes()) {
|
||||||
divider /= sizeof(unsigned short) * 8;
|
divider /= sizeof(unsigned short) * 8;
|
||||||
unit[1] = 'b';
|
unit[1] = 'b';
|
||||||
}
|
}
|
||||||
@ -76,11 +76,11 @@ cString cIptvDeviceStatistics::GetStatistic()
|
|||||||
elapsed ? : elapsed = 1;
|
elapsed ? : elapsed = 1;
|
||||||
float divider = elapsed / 1000;
|
float divider = elapsed / 1000;
|
||||||
char unit[] = { ' ', 'B', '/', 's', '\0' };
|
char unit[] = { ' ', 'B', '/', 's', '\0' };
|
||||||
if (IptvConfig.GetStatsInKilos()) {
|
if (IptvConfig.IsStatsUnitInKilos()) {
|
||||||
divider *= KILOBYTE(1);
|
divider *= KILOBYTE(1);
|
||||||
unit[0] = 'k';
|
unit[0] = 'k';
|
||||||
}
|
}
|
||||||
if (!IptvConfig.GetStatsInBytes()) {
|
if (!IptvConfig.IsStatsUnitInBytes()) {
|
||||||
divider /= sizeof(unsigned short) * 8;
|
divider /= sizeof(unsigned short) * 8;
|
||||||
unit[1] = 'b';
|
unit[1] = 'b';
|
||||||
}
|
}
|
||||||
@ -160,11 +160,11 @@ cString cIptvStreamerStatistics::GetStatistic()
|
|||||||
elapsed ? : elapsed = 1;
|
elapsed ? : elapsed = 1;
|
||||||
float divider = elapsed / 1000;
|
float divider = elapsed / 1000;
|
||||||
char unit[] = { ' ', 'B', '/', 's', '\0' };
|
char unit[] = { ' ', 'B', '/', 's', '\0' };
|
||||||
if (IptvConfig.GetStatsInKilos()) {
|
if (IptvConfig.IsStatsUnitInKilos()) {
|
||||||
divider *= KILOBYTE(1);
|
divider *= KILOBYTE(1);
|
||||||
unit[0] = 'k';
|
unit[0] = 'k';
|
||||||
}
|
}
|
||||||
if (!IptvConfig.GetStatsInBytes()) {
|
if (!IptvConfig.IsStatsUnitInBytes()) {
|
||||||
divider /= sizeof(unsigned short) * 8;
|
divider /= sizeof(unsigned short) * 8;
|
||||||
unit[1] = 'b';
|
unit[1] = 'b';
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user