From fe9b2103f32d0b60b036307ae560674c32f91a91 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sat, 9 Feb 2002 14:50:05 +0100 Subject: Only reporting the 'EPG bugfix statistics' if there really were any fixes --- HISTORY | 1 + eit.c | 47 +++++++++++++++++++++++++++-------------------- 2 files changed, 28 insertions(+), 20 deletions(-) diff --git a/HISTORY b/HISTORY index d4feeb0c..fa20c78f 100644 --- a/HISTORY +++ b/HISTORY @@ -976,3 +976,4 @@ Video Disk Recorder Revision History (thanks to Matthias Schniedermeyer for helping to debug this one). - Changed the estimated data rate for calculating the remaining disk capacity to 25.75 MB/min. +- Only reporting the 'EPG bugfix statistics' if there really were any fixes. diff --git a/eit.c b/eit.c index 2860fc4c..99bcdfff 100644 --- a/eit.c +++ b/eit.c @@ -16,7 +16,7 @@ * the Free Software Foundation; either version 2 of the License, or * * (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" @@ -352,7 +352,7 @@ void cEventInfo::Dump(FILE *f, const char *Prefix) const } } -#define MAXEPGBUGFIXSTATS 6 +#define MAXEPGBUGFIXSTATS 5 #define MAXEPGBUGFIXCHANS 50 struct tEpgBugFixStats { int hits; @@ -381,32 +381,39 @@ static void EpgBugFixStat(int Number, unsigned int ServiceID) static void ReportEpgBugFixStats(bool Reset = false) { if (Setup.EPGBugfixLevel > 0) { - dsyslog(LOG_INFO, "====================="); - dsyslog(LOG_INFO, "EPG bugfix statistics"); - dsyslog(LOG_INFO, "====================="); - dsyslog(LOG_INFO, "IF SOMEBODY WHO IS IN CHARGE OF THE EPG DATA FOR ONE OF THE LISTED"); - dsyslog(LOG_INFO, "CHANNELS READS THIS: PLEASE TAKE A LOOK AT THE FUNCTION cEventInfo::FixEpgBugs()"); - dsyslog(LOG_INFO, "IN VDR/eit.c TO LEARN WHAT'S WRONG WITH YOUR DATA, AND FIX IT!"); - dsyslog(LOG_INFO, "====================="); - dsyslog(LOG_INFO, "Fix\tHits\tChannels"); + bool GotHits = false; char buffer[1024]; for (int i = 0; i < MAXEPGBUGFIXSTATS; i++) { const char *delim = "\t"; tEpgBugFixStats *p = &EpgBugFixStats[i]; - char *q = buffer; - q += snprintf(q, sizeof(buffer) - (q - buffer), "%d\t%d", i, p->hits); - for (int c = 0; c < p->n; c++) { - cChannel *channel = Channels.GetByServiceID(p->serviceIDs[c]); - if (channel) { - q += snprintf(q, sizeof(buffer) - (q - buffer), "%s%s", delim, channel->name); - delim = ", "; + if (p->hits) { + if (!GotHits) { + dsyslog(LOG_INFO, "====================="); + dsyslog(LOG_INFO, "EPG bugfix statistics"); + dsyslog(LOG_INFO, "====================="); + dsyslog(LOG_INFO, "IF SOMEBODY WHO IS IN CHARGE OF THE EPG DATA FOR ONE OF THE LISTED"); + dsyslog(LOG_INFO, "CHANNELS READS THIS: PLEASE TAKE A LOOK AT THE FUNCTION cEventInfo::FixEpgBugs()"); + dsyslog(LOG_INFO, "IN VDR/eit.c TO LEARN WHAT'S WRONG WITH YOUR DATA, AND FIX IT!"); + dsyslog(LOG_INFO, "====================="); + dsyslog(LOG_INFO, "Fix\tHits\tChannels"); + GotHits = true; + } + char *q = buffer; + q += snprintf(q, sizeof(buffer) - (q - buffer), "%d\t%d", i, p->hits); + for (int c = 0; c < p->n; c++) { + cChannel *channel = Channels.GetByServiceID(p->serviceIDs[c]); + if (channel) { + q += snprintf(q, sizeof(buffer) - (q - buffer), "%s%s", delim, channel->name); + delim = ", "; + } } - } - dsyslog(LOG_INFO, "%s", buffer); + dsyslog(LOG_INFO, "%s", buffer); + } if (Reset) p->hits = p->n = 0; } - dsyslog(LOG_INFO, "====================="); + if (GotHits) + dsyslog(LOG_INFO, "====================="); } } -- cgit v1.2.3