summaryrefslogtreecommitdiff
path: root/eit.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <kls (at) cadsoft (dot) de>2002-02-03 18:00:00 +0100
committerKlaus Schmidinger <kls (at) cadsoft (dot) de>2002-02-03 18:00:00 +0100
commitef0a53af7282b14bd40f2087de28fc12a94e672b (patch)
tree8346e35a67828712f467afe6e371e54383f496ae /eit.c
parent3db2d636b2757326323418b5293ebc7307bf161d (diff)
downloadvdr-patch-lnbsharing-ef0a53af7282b14bd40f2087de28fc12a94e672b.tar.gz
vdr-patch-lnbsharing-ef0a53af7282b14bd40f2087de28fc12a94e672b.tar.bz2
Version 0.99pre5vdr-0.99pre5
- Updated channel settings for 'N24' (thanks to Andreas Gebel). - Fixed handling hierarchical recordings menu in case of directories starting with the same sequence of characters. - Fixed handling timers on the 29th, 30th or 31st of a month in case the next month has less than 31 days. - Added a description of the sort order of individual episodes in the recordings menu to the MANUAL. - Removed the EPG bugfix for "Title / Subtitle" cleanup. Apparently Pro-7 has finally stopped this nasty habit. - Added some EPG bugfix statistics (printed to the log file every time the EPG data is cleaned up and when VDR is terminated). Maybe somebody in charge of the EPG data at the listed channels will read this and take the necessary actions to fix these things... - Changed the [dei]syslog macros in tools.h to use a variable number of args, thus making it safe to use them in nested 'if/else' statements. - Fixed error handling in establishing an SVDRP connection (thanks to Davide Achilli) for pointing this out). - The new configuration file 'svdrphosts.conf' is now used to define which hosts may access the SVDRP port (by default only 'localhost' has access). See FORMATS for details. - The special keywords TITLE and EPISODE can now be used in timer file names (see MANUAL and FORMATS for details). - The new setup parameter NameInstantRecord can be used to define how an instant recording will be named (see MANUAL for details). - When looking for the EPG record of the timer that starts a recording, now that record is taken which covers the time calculated as 'start + (Setup.MarginStart * 2) + 1)' in order to have a better chance of hitting the right record in case of an instant recording. Timers that start further in the future should always be programmed via the "Schedules" menu. - The special VPIDs '0' and '1' are now used to enable recording radio channels. Actually '0' should be enough, but '1' must be used with encrypted channels (driver bug?). Note, though, that since VDR is mainly a *video recorder*, some features like, e. g., the progress display, may not work as expected with radio recordings. Thanks to Michael Paar. - Fixed a problem with the ERR macro defined by ncurses.h (thanks to Artur Skawina).
Diffstat (limited to 'eit.c')
-rw-r--r--eit.c85
1 files changed, 69 insertions, 16 deletions
diff --git a/eit.c b/eit.c
index ed757d2..2860fc4 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.31 2002/01/13 16:14:31 kls Exp $
+ * $Id: eit.c 1.33 2002/02/02 12:12:26 kls Exp $
***************************************************************************/
#include "eit.h"
@@ -352,6 +352,64 @@ void cEventInfo::Dump(FILE *f, const char *Prefix) const
}
}
+#define MAXEPGBUGFIXSTATS 6
+#define MAXEPGBUGFIXCHANS 50
+struct tEpgBugFixStats {
+ int hits;
+ int n;
+ unsigned short serviceIDs[MAXEPGBUGFIXCHANS];
+ tEpgBugFixStats(void) { hits = n = 0; }
+ };
+
+tEpgBugFixStats EpgBugFixStats[MAXEPGBUGFIXSTATS];
+
+static void EpgBugFixStat(int Number, unsigned int ServiceID)
+{
+ if (0 <= Number && Number < MAXEPGBUGFIXSTATS) {
+ tEpgBugFixStats *p = &EpgBugFixStats[Number];
+ p->hits++;
+ int i = 0;
+ for (; i < p->n; i++) {
+ if (p->serviceIDs[i] == ServiceID)
+ break;
+ }
+ if (i == p->n && p->n < MAXEPGBUGFIXCHANS)
+ p->serviceIDs[p->n++] = 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");
+ 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 = ", ";
+ }
+ }
+ dsyslog(LOG_INFO, "%s", buffer);
+ if (Reset)
+ p->hits = p->n = 0;
+ }
+ dsyslog(LOG_INFO, "=====================");
+ }
+}
+
void cEventInfo::FixEpgBugs(void)
{
// VDR can't usefully handle newline characters in the EPG data, so let's
@@ -367,20 +425,6 @@ void cEventInfo::FixEpgBugs(void)
// EPG data. Let's fix their bugs as good as we can:
if (pTitle) {
- // Pro7 preceeds the Subtitle with the Title:
- //
- // Title
- // Title / Subtitle
- //
- if (pSubtitle && strstr(pSubtitle, pTitle) == pSubtitle) {
- char *p = pSubtitle + strlen(pTitle);
- const char *delim = " / ";
- if (strstr(p, delim) == p) {
- p += strlen(delim);
- memmove(pSubtitle, p, strlen(p) + 1);
- }
- }
-
// VOX and VIVA put the Subtitle in quotes and use either the Subtitle
// or the Extended Description field, depending on how long the string is:
//
@@ -400,6 +444,7 @@ void cEventInfo::FixEpgBugs(void)
delete pExtendedDescription;
pSubtitle = s;
pExtendedDescription = d;
+ EpgBugFixStat(0, GetServiceID());
}
}
}
@@ -416,6 +461,7 @@ void cEventInfo::FixEpgBugs(void)
memmove(pSubtitle, pSubtitle + 1, strlen(pSubtitle));
pExtendedDescription = pSubtitle;
pSubtitle = NULL;
+ EpgBugFixStat(1, GetServiceID());
}
}
@@ -427,6 +473,7 @@ void cEventInfo::FixEpgBugs(void)
if (pSubtitle && strcmp(pTitle, pSubtitle) == 0) {
delete pSubtitle;
pSubtitle = NULL;
+ EpgBugFixStat(2, GetServiceID());
}
// ZDF.info puts the Subtitle between double quotes, which is nothing
@@ -442,6 +489,7 @@ void cEventInfo::FixEpgBugs(void)
char *p = strrchr(pSubtitle, '"');
if (p)
*p = 0;
+ EpgBugFixStat(3, GetServiceID());
}
}
@@ -460,8 +508,10 @@ void cEventInfo::FixEpgBugs(void)
char *p = pExtendedDescription + 1;
while (*p) {
if (*p == '-' && *(p + 1) == ' ' && *(p + 2) && islower(*(p - 1)) && islower(*(p + 2))) {
- if (!startswith(p + 2, "und ")) // special case in German, as in "Lach- und Sachgeschichten"
+ if (!startswith(p + 2, "und ")) { // special case in German, as in "Lach- und Sachgeschichten"
memmove(p, p + 2, strlen(p + 2) + 1);
+ EpgBugFixStat(4, GetServiceID());
+ }
}
p++;
}
@@ -845,6 +895,8 @@ cSIProcessor::cSIProcessor(const char *FileName)
cSIProcessor::~cSIProcessor()
{
+ if (masterSIProcessor)
+ ReportEpgBugFixStats();
active = false;
Cancel(3);
ShutDownFilters();
@@ -913,6 +965,7 @@ void cSIProcessor::Action()
schedules->Cleanup();
schedulesMutex.Unlock();
lastCleanup = now;
+ ReportEpgBugFixStats(true);
}
if (epgDataFileName && now - lastDump > 600)
{