summaryrefslogtreecommitdiff
path: root/epg.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <kls (at) cadsoft (dot) de>2006-01-22 18:00:00 +0100
committerKlaus Schmidinger <kls (at) cadsoft (dot) de>2006-01-22 18:00:00 +0100
commit446b0e8e0b94b997293aef2f63220c5f8a68bf0f (patch)
treeb2d3e77137f068f9fc3682197c9e7b91afba5fe1 /epg.c
parent78e3da813cb4345e57934a9a60f6316f1e257307 (diff)
downloadvdr-patch-lnbsharing-446b0e8e0b94b997293aef2f63220c5f8a68bf0f.tar.gz
vdr-patch-lnbsharing-446b0e8e0b94b997293aef2f63220c5f8a68bf0f.tar.bz2
Version 1.3.40vdr-1.3.40
- Fixed a second place where a message should be given when an instant recording is started (reported by Jesus Bravo Alvarez). - Modified logging so that even on NPTL systems each line in the log file shows the individual thread's pid (based on a suggestion from Francois-Xavier Kowalski). - Fixed a problem with @plugin in keymacros.conf in case the named plugin is not loaded (reported by Franz Gangkofer). - Fixed a crash after executing the SVDRP command CLRE, caused by dangling 'schedule' pointers from cChannel objects (reported by Malte Schröder). - Updated the Finnish OSD texts (thanks to Rolf Ahrenberg). - Improved NULL checking in strreplace(). - Fixed a crash in the Schedule menu with events that have no title (reported by Rolf Ahrenberg). cEvent::FixEpgBugs() now assigns a "No title" string to events that have no title. - Updated the Estonian OSD texts (thanks to Arthur Konovalov). - Recordings are now only started if there is at least 300MB free disk space (suggested by Markus Hahn). - When entering text via the numeric keys, the cursor now automatically advances (based on a patch from Rolf Ahrenberg). - Updated the Polish OSD texts and the fontosd-iso8859-2.c file (thanks to Jaroslaw Swierczynski). - Disabled the "buffer reserve" in Transfer Mode. Last chance to complain if you really need it - it will be completely removed in the next version. If you are experiencing problems with a/v running out of sync, try the latest driver and firmware (if you are using a full featured DVB card). - Switching channels with the Up/Down or Channel+/Channel- keys now works a lot faster when the repeat function kicks in, by not actually switching the channel every time, but rather only displaying the channel info and doing the final switch when the key is released. - The channel display is now updated _before_ the channel is switched. - Added a missing initialization of 'timeout' in the cDisplayChannel constructor. - Fixed detecting if there can be any useful further input when entering channel numbers (thanks to Thomas Bergwinkl). - Updated the Spanish OSD texts (thanks to Jesus Bravo Alvarez). - Fixed handling the '0' key for switching between the last two channels (thanks to Thomas Bergwinkl).
Diffstat (limited to 'epg.c')
-rw-r--r--epg.c334
1 files changed, 168 insertions, 166 deletions
diff --git a/epg.c b/epg.c
index 79c1176..384f86b 100644
--- a/epg.c
+++ b/epg.c
@@ -7,7 +7,7 @@
* Original version (as used in VDR before 1.3.0) written by
* Robert Schneider <Robert.Schneider@web.de> and Rolf Hakenes <hakenes@hippomi.de>.
*
- * $Id: epg.c 1.49 2006/01/15 13:58:30 kls Exp $
+ * $Id: epg.c 1.51 2006/01/20 14:09:48 kls Exp $
*/
#include "epg.h"
@@ -422,197 +422,196 @@ void cEvent::FixEpgBugs(void)
strreplace(description, '\x86', ' ');
strreplace(description, '\x87', ' ');
+ if (!title) {
+ // we don't want any "(null)" titles
+ title = strcpyrealloc(title, tr("No title"));
+ EpgBugFixStat(12, ChannelID());
+ }
+
if (Setup.EPGBugfixLevel == 0)
return;
// Some TV stations apparently have their own idea about how to fill in the
// EPG data. Let's fix their bugs as good as we can:
- if (title) {
-
- // Some channels put the ShortText in quotes and use either the ShortText
- // or the Description field, depending on how long the string is:
- //
- // Title
- // "ShortText". Description
- //
- if ((shortText == NULL) != (description == NULL)) {
- char *p = shortText ? shortText : description;
- if (*p == '"') {
- const char *delim = "\".";
- char *e = strstr(p + 1, delim);
- if (e) {
- *e = 0;
- char *s = strdup(p + 1);
- char *d = strdup(e + strlen(delim));
- free(shortText);
- free(description);
- shortText = s;
- description = d;
- EpgBugFixStat(1, ChannelID());
- }
- }
- }
- // Some channels put the Description into the ShortText (preceded
- // by a blank) if there is no actual ShortText and the Description
- // is short enough:
- //
- // Title
- // Description
- //
- if (shortText && !description) {
- if (*shortText == ' ') {
- memmove(shortText, shortText + 1, strlen(shortText));
- description = shortText;
- shortText = NULL;
- EpgBugFixStat(2, ChannelID());
+ // Some channels put the ShortText in quotes and use either the ShortText
+ // or the Description field, depending on how long the string is:
+ //
+ // Title
+ // "ShortText". Description
+ //
+ if ((shortText == NULL) != (description == NULL)) {
+ char *p = shortText ? shortText : description;
+ if (*p == '"') {
+ const char *delim = "\".";
+ char *e = strstr(p + 1, delim);
+ if (e) {
+ *e = 0;
+ char *s = strdup(p + 1);
+ char *d = strdup(e + strlen(delim));
+ free(shortText);
+ free(description);
+ shortText = s;
+ description = d;
+ EpgBugFixStat(1, ChannelID());
}
}
+ }
- // Sometimes they repeat the Title in the ShortText:
- //
- // Title
- // Title
- //
- if (shortText && strcmp(title, shortText) == 0) {
- free(shortText);
+ // Some channels put the Description into the ShortText (preceded
+ // by a blank) if there is no actual ShortText and the Description
+ // is short enough:
+ //
+ // Title
+ // Description
+ //
+ if (shortText && !description) {
+ if (*shortText == ' ') {
+ memmove(shortText, shortText + 1, strlen(shortText));
+ description = shortText;
shortText = NULL;
- EpgBugFixStat(3, ChannelID());
+ EpgBugFixStat(2, ChannelID());
}
+ }
- // Some channels put the ShortText between double quotes, which is nothing
- // but annoying (some even put a '.' after the closing '"'):
- //
- // Title
- // "ShortText"[.]
- //
- if (shortText && *shortText == '"') {
- int l = strlen(shortText);
- if (l > 2 && (shortText[l - 1] == '"' || (shortText[l - 1] == '.' && shortText[l - 2] == '"'))) {
- memmove(shortText, shortText + 1, l);
- char *p = strrchr(shortText, '"');
- if (p)
- *p = 0;
- EpgBugFixStat(4, ChannelID());
- }
+ // Sometimes they repeat the Title in the ShortText:
+ //
+ // Title
+ // Title
+ //
+ if (shortText && strcmp(title, shortText) == 0) {
+ free(shortText);
+ shortText = NULL;
+ EpgBugFixStat(3, ChannelID());
+ }
+
+ // Some channels put the ShortText between double quotes, which is nothing
+ // but annoying (some even put a '.' after the closing '"'):
+ //
+ // Title
+ // "ShortText"[.]
+ //
+ if (shortText && *shortText == '"') {
+ int l = strlen(shortText);
+ if (l > 2 && (shortText[l - 1] == '"' || (shortText[l - 1] == '.' && shortText[l - 2] == '"'))) {
+ memmove(shortText, shortText + 1, l);
+ char *p = strrchr(shortText, '"');
+ if (p)
+ *p = 0;
+ EpgBugFixStat(4, ChannelID());
}
+ }
- if (Setup.EPGBugfixLevel <= 1)
- return;
+ if (Setup.EPGBugfixLevel <= 1)
+ return;
- // Some channels apparently try to do some formatting in the texts,
- // which is a bad idea because they have no way of knowing the width
- // of the window that will actually display the text.
- // Remove excess whitespace:
- title = compactspace(title);
- shortText = compactspace(shortText);
- description = compactspace(description);
+ // Some channels apparently try to do some formatting in the texts,
+ // which is a bad idea because they have no way of knowing the width
+ // of the window that will actually display the text.
+ // Remove excess whitespace:
+ title = compactspace(title);
+ shortText = compactspace(shortText);
+ description = compactspace(description);
#define MAX_USEFUL_EPISODE_LENGTH 40
- // Some channels put a whole lot of information in the ShortText and leave
- // the Description totally empty. So if the ShortText length exceeds
- // MAX_USEFUL_EPISODE_LENGTH, let's put this into the Description
- // instead:
- if (!isempty(shortText) && isempty(description)) {
- if (strlen(shortText) > MAX_USEFUL_EPISODE_LENGTH) {
- free(description);
- description = shortText;
- shortText = NULL;
- EpgBugFixStat(6, ChannelID());
- }
+ // Some channels put a whole lot of information in the ShortText and leave
+ // the Description totally empty. So if the ShortText length exceeds
+ // MAX_USEFUL_EPISODE_LENGTH, let's put this into the Description
+ // instead:
+ if (!isempty(shortText) && isempty(description)) {
+ if (strlen(shortText) > MAX_USEFUL_EPISODE_LENGTH) {
+ free(description);
+ description = shortText;
+ shortText = NULL;
+ EpgBugFixStat(6, ChannelID());
}
+ }
- // Some channels put the same information into ShortText and Description.
- // In that case we delete one of them:
- if (shortText && description && strcmp(shortText, description) == 0) {
- if (strlen(shortText) > MAX_USEFUL_EPISODE_LENGTH) {
- free(shortText);
- shortText = NULL;
- }
- else {
- free(description);
- description = NULL;
- }
- EpgBugFixStat(7, ChannelID());
+ // Some channels put the same information into ShortText and Description.
+ // In that case we delete one of them:
+ if (shortText && description && strcmp(shortText, description) == 0) {
+ if (strlen(shortText) > MAX_USEFUL_EPISODE_LENGTH) {
+ free(shortText);
+ shortText = NULL;
+ }
+ else {
+ free(description);
+ description = NULL;
}
+ EpgBugFixStat(7, ChannelID());
+ }
- // 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:
- strreplace(title, '`', '\'');
- strreplace(shortText, '`', '\'');
- strreplace(description, '`', '\'');
+ // 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:
+ strreplace(title, '`', '\'');
+ strreplace(shortText, '`', '\'');
+ strreplace(description, '`', '\'');
- if (Setup.EPGBugfixLevel <= 2)
- return;
+ if (Setup.EPGBugfixLevel <= 2)
+ return;
- // The stream components have a "description" field which some channels
- // apparently have no idea of how to set correctly:
- if (components) {
- for (int i = 0; i < components->NumComponents(); i++) {
- tComponent *p = components->Component(i);
- switch (p->stream) {
- case 0x01: { // video
- if (p->description) {
- if (strcasecmp(p->description, "Video") == 0 ||
- strcasecmp(p->description, "Bildformat") == 0) {
- // Yes, we know it's video - that's what the 'stream' code
- // is for! But _which_ video is it?
- free(p->description);
- p->description = NULL;
- EpgBugFixStat(8, ChannelID());
- }
- }
- if (!p->description) {
- switch (p->type) {
- case 0x01:
- case 0x05: p->description = strdup("4:3"); break;
- case 0x02:
- case 0x03:
- case 0x06:
- case 0x07: p->description = strdup("16:9"); break;
- case 0x04:
- case 0x08: p->description = strdup(">16:9"); break;
- case 0x09:
- case 0x0D: p->description = strdup("HD 4:3"); break;
- case 0x0A:
- case 0x0B:
- case 0x0E:
- case 0x0F: p->description = strdup("HD 16:9"); break;
- case 0x0C:
- case 0x10: p->description = strdup("HD >16:9"); break;
- }
- EpgBugFixStat(9, ChannelID());
+ // The stream components have a "description" field which some channels
+ // apparently have no idea of how to set correctly:
+ if (components) {
+ for (int i = 0; i < components->NumComponents(); i++) {
+ tComponent *p = components->Component(i);
+ switch (p->stream) {
+ case 0x01: { // video
+ if (p->description) {
+ if (strcasecmp(p->description, "Video") == 0 ||
+ strcasecmp(p->description, "Bildformat") == 0) {
+ // Yes, we know it's video - that's what the 'stream' code
+ // is for! But _which_ video is it?
+ free(p->description);
+ p->description = NULL;
+ EpgBugFixStat(8, ChannelID());
}
}
- break;
- case 0x02: { // audio
- if (p->description) {
- if (strcasecmp(p->description, "Audio") == 0) {
- // Yes, we know it's audio - that's what the 'stream' code
- // is for! But _which_ audio is it?
- free(p->description);
- p->description = NULL;
- EpgBugFixStat(10, ChannelID());
- }
- }
- if (!p->description) {
- switch (p->type) {
- case 0x05: p->description = strdup("Dolby Digital"); break;
- // all others will just display the language
- }
- EpgBugFixStat(11, ChannelID());
+ if (!p->description) {
+ switch (p->type) {
+ case 0x01:
+ case 0x05: p->description = strdup("4:3"); break;
+ case 0x02:
+ case 0x03:
+ case 0x06:
+ case 0x07: p->description = strdup("16:9"); break;
+ case 0x04:
+ case 0x08: p->description = strdup(">16:9"); break;
+ case 0x09:
+ case 0x0D: p->description = strdup("HD 4:3"); break;
+ case 0x0A:
+ case 0x0B:
+ case 0x0E:
+ case 0x0F: p->description = strdup("HD 16:9"); break;
+ case 0x0C:
+ case 0x10: p->description = strdup("HD >16:9"); break;
+ }
+ EpgBugFixStat(9, ChannelID());
+ }
+ }
+ break;
+ case 0x02: { // audio
+ if (p->description) {
+ if (strcasecmp(p->description, "Audio") == 0) {
+ // Yes, we know it's audio - that's what the 'stream' code
+ // is for! But _which_ audio is it?
+ free(p->description);
+ p->description = NULL;
+ EpgBugFixStat(10, ChannelID());
}
}
- break;
- }
- }
- }
- }
- else {
- // we don't want any "(null)" titles
- title = strcpyrealloc(title, tr("No title"));
- EpgBugFixStat(12, ChannelID());
+ if (!p->description) {
+ switch (p->type) {
+ case 0x05: p->description = strdup("Dolby Digital"); break;
+ // all others will just display the language
+ }
+ EpgBugFixStat(11, ChannelID());
+ }
+ }
+ break;
+ }
+ }
}
}
@@ -935,7 +934,10 @@ bool cSchedules::ClearAll(void)
cSchedulesLock SchedulesLock(true, 1000);
cSchedules *s = (cSchedules *)Schedules(SchedulesLock);
if (s) {
- s->Clear();
+ for (cTimer *Timer = Timers.First(); Timer; Timer = Timers.Next(Timer))
+ Timer->SetEvent(NULL);
+ for (cSchedule *Schedule = s->First(); Schedule; Schedule = s->Next(Schedule))
+ Schedule->Cleanup(INT_MAX);
return true;
}
return false;