summaryrefslogtreecommitdiff
path: root/eit.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2003-01-06 15:09:11 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2003-01-06 15:09:11 +0100
commit4b1440737a1929ad56ed8ad4336cd090695de414 (patch)
tree0527642602158ddf7fa00755cb01ebebd1b71d26 /eit.c
parent4e15f6d658139fca773b76088bf1523839c20ffd (diff)
downloadvdr-4b1440737a1929ad56ed8ad4336cd090695de414.tar.gz
vdr-4b1440737a1929ad56ed8ad4336cd090695de414.tar.bz2
Added an EPG bugfix for too long Subtitles and empty Extended Description
Diffstat (limited to 'eit.c')
-rw-r--r--eit.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/eit.c b/eit.c
index a2577960..e2e0fe72 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.62 2003/01/06 14:10:37 kls Exp $
+ * $Id: eit.c 1.63 2003/01/06 15:05:46 kls Exp $
***************************************************************************/
#include "eit.h"
@@ -399,8 +399,8 @@ bool cEventInfo::Read(FILE *f, cSchedule *Schedule)
return false;
}
-#define MAXEPGBUGFIXSTATS 6
-#define MAXEPGBUGFIXCHANS 50
+#define MAXEPGBUGFIXSTATS 7
+#define MAXEPGBUGFIXCHANS 100
struct tEpgBugFixStats {
int hits;
int n;
@@ -597,6 +597,20 @@ void cEventInfo::FixEpgBugs(void)
}
}
+#define MAX_USEFUL_SUBTITLE_LENGTH 40
+ // Some channels put a whole lot of information in the Subtitle and leave
+ // the Extended Description totally empty. So if the Subtitle length exceeds
+ // MAX_USEFUL_SUBTITLE_LENGTH, let's put this into the Extended Description
+ // instead:
+ if (!isempty(pSubtitle) && isempty(pExtendedDescription)) {
+ if (strlen(pSubtitle) > MAX_USEFUL_SUBTITLE_LENGTH) {
+ free(pExtendedDescription);
+ pExtendedDescription = pSubtitle;
+ pSubtitle = NULL;
+ EpgBugFixStat(5, GetChannelID());
+ }
+ }
+
// Some channels use the ` ("backtick") character, where a ' (single quote)
// would be normally used. Actually, "backticks" in normal text don't make
// much sense, so let's replace them: