Fixed EPG bugfix statistics to avoid log entires for undefined channels

This commit is contained in:
Klaus Schmidinger 2003-05-18 14:13:02 +02:00
parent c58f61392b
commit 2ec3f0342b
3 changed files with 26 additions and 14 deletions

View File

@ -665,3 +665,7 @@ Matthias Raus <matthias-raus@web.de>
Marc Rovira Vall <tm05462@salleURL.edu> and Ramon Roca <ramon.roca@xcombo.com>
for translating OSD texts to the Catalanian language
Lars Bläser <LBlaeser@hofheim.de>
for reporting a bug in EPG bugfix statistics which made log entires for undefined
channels

View File

@ -2168,3 +2168,5 @@ Video Disk Recorder Revision History
- Updated 'channels.conf.cable' (thanks to Stefan Hußfeldt).
- Fixed reading 'epg.data' for channels with non-zero RID (thanks to Oliver
Endriss for reporting this one).
- Fixed EPG bugfix statistics to avoid log entires for undefined channels (thanks
to Lars Bläser for reporting this one).

34
eit.c
View File

@ -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.77 2003/05/18 13:13:31 kls Exp $
* $Id: eit.c 1.78 2003/05/18 14:10:25 kls Exp $
***************************************************************************/
#include "eit.h"
@ -434,27 +434,33 @@ static void ReportEpgBugFixStats(bool Reset = false)
const char *delim = "\t";
tEpgBugFixStats *p = &EpgBugFixStats[i];
if (p->hits) {
if (!GotHits) {
dsyslog("=====================");
dsyslog("EPG bugfix statistics");
dsyslog("=====================");
dsyslog("IF SOMEBODY WHO IS IN CHARGE OF THE EPG DATA FOR ONE OF THE LISTED");
dsyslog("CHANNELS READS THIS: PLEASE TAKE A LOOK AT THE FUNCTION cEventInfo::FixEpgBugs()");
dsyslog("IN VDR/eit.c TO LEARN WHAT'S WRONG WITH YOUR DATA, AND FIX IT!");
dsyslog("=====================");
dsyslog("Fix\tHits\tChannels");
GotHits = true;
}
bool PrintedStats = false;
char *q = buffer;
q += snprintf(q, sizeof(buffer) - (q - buffer), "%d\t%d", i, p->hits);
*buffer = 0;
for (int c = 0; c < p->n; c++) {
cChannel *channel = Channels.GetByChannelID(p->channelIDs[c], true);
if (channel) {
if (!GotHits) {
dsyslog("=====================");
dsyslog("EPG bugfix statistics");
dsyslog("=====================");
dsyslog("IF SOMEBODY WHO IS IN CHARGE OF THE EPG DATA FOR ONE OF THE LISTED");
dsyslog("CHANNELS READS THIS: PLEASE TAKE A LOOK AT THE FUNCTION cEventInfo::FixEpgBugs()");
dsyslog("IN VDR/eit.c TO LEARN WHAT'S WRONG WITH YOUR DATA, AND FIX IT!");
dsyslog("=====================");
dsyslog("Fix\tHits\tChannels");
GotHits = true;
}
if (!PrintedStats) {
q += snprintf(q, sizeof(buffer) - (q - buffer), "%d\t%d", i, p->hits);
PrintedStats = true;
}
q += snprintf(q, sizeof(buffer) - (q - buffer), "%s%s", delim, channel->Name());
delim = ", ";
}
}
dsyslog("%s", buffer);
if (*buffer)
dsyslog("%s", buffer);
}
if (Reset)
p->hits = p->n = 0;