Only reporting the 'EPG bugfix statistics' if there really were any fixes

This commit is contained in:
Klaus Schmidinger 2002-02-09 14:50:05 +01:00
parent 889e70803f
commit fe9b2103f3
2 changed files with 28 additions and 20 deletions

View File

@ -976,3 +976,4 @@ Video Disk Recorder Revision History
(thanks to Matthias Schniedermeyer for helping to debug this one). (thanks to Matthias Schniedermeyer for helping to debug this one).
- Changed the estimated data rate for calculating the remaining disk capacity - Changed the estimated data rate for calculating the remaining disk capacity
to 25.75 MB/min. to 25.75 MB/min.
- Only reporting the 'EPG bugfix statistics' if there really were any fixes.

19
eit.c
View File

@ -16,7 +16,7 @@
* the Free Software Foundation; either version 2 of the License, or * * the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. * * (at your option) any later version. *
* * * *
* $Id: eit.c 1.33 2002/02/02 12:12:26 kls Exp $ * $Id: eit.c 1.34 2002/02/09 14:48:43 kls Exp $
***************************************************************************/ ***************************************************************************/
#include "eit.h" #include "eit.h"
@ -352,7 +352,7 @@ void cEventInfo::Dump(FILE *f, const char *Prefix) const
} }
} }
#define MAXEPGBUGFIXSTATS 6 #define MAXEPGBUGFIXSTATS 5
#define MAXEPGBUGFIXCHANS 50 #define MAXEPGBUGFIXCHANS 50
struct tEpgBugFixStats { struct tEpgBugFixStats {
int hits; int hits;
@ -381,6 +381,13 @@ static void EpgBugFixStat(int Number, unsigned int ServiceID)
static void ReportEpgBugFixStats(bool Reset = false) static void ReportEpgBugFixStats(bool Reset = false)
{ {
if (Setup.EPGBugfixLevel > 0) { if (Setup.EPGBugfixLevel > 0) {
bool GotHits = false;
char buffer[1024];
for (int i = 0; i < MAXEPGBUGFIXSTATS; i++) {
const char *delim = "\t";
tEpgBugFixStats *p = &EpgBugFixStats[i];
if (p->hits) {
if (!GotHits) {
dsyslog(LOG_INFO, "====================="); dsyslog(LOG_INFO, "=====================");
dsyslog(LOG_INFO, "EPG bugfix statistics"); dsyslog(LOG_INFO, "EPG bugfix statistics");
dsyslog(LOG_INFO, "====================="); dsyslog(LOG_INFO, "=====================");
@ -389,10 +396,8 @@ static void ReportEpgBugFixStats(bool Reset = false)
dsyslog(LOG_INFO, "IN VDR/eit.c TO LEARN WHAT'S WRONG WITH YOUR DATA, AND FIX IT!"); dsyslog(LOG_INFO, "IN VDR/eit.c TO LEARN WHAT'S WRONG WITH YOUR DATA, AND FIX IT!");
dsyslog(LOG_INFO, "====================="); dsyslog(LOG_INFO, "=====================");
dsyslog(LOG_INFO, "Fix\tHits\tChannels"); dsyslog(LOG_INFO, "Fix\tHits\tChannels");
char buffer[1024]; GotHits = true;
for (int i = 0; i < MAXEPGBUGFIXSTATS; i++) { }
const char *delim = "\t";
tEpgBugFixStats *p = &EpgBugFixStats[i];
char *q = buffer; char *q = buffer;
q += snprintf(q, sizeof(buffer) - (q - buffer), "%d\t%d", i, p->hits); q += snprintf(q, sizeof(buffer) - (q - buffer), "%d\t%d", i, p->hits);
for (int c = 0; c < p->n; c++) { for (int c = 0; c < p->n; c++) {
@ -403,9 +408,11 @@ static void ReportEpgBugFixStats(bool Reset = false)
} }
} }
dsyslog(LOG_INFO, "%s", buffer); dsyslog(LOG_INFO, "%s", buffer);
}
if (Reset) if (Reset)
p->hits = p->n = 0; p->hits = p->n = 0;
} }
if (GotHits)
dsyslog(LOG_INFO, "====================="); dsyslog(LOG_INFO, "=====================");
} }
} }