From 446b0e8e0b94b997293aef2f63220c5f8a68bf0f Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sun, 22 Jan 2006 18:00:00 +0100 Subject: =?UTF-8?q?Version=201.3.40=20-=20Fixed=20a=20second=20place=20whe?= =?UTF-8?q?re=20a=20message=20should=20be=20given=20when=20an=20instant=20?= =?UTF-8?q?recording=20=20=20is=20started=20(reported=20by=20Jesus=20Bravo?= =?UTF-8?q?=20Alvarez).=20-=20Modified=20logging=20so=20that=20even=20on?= =?UTF-8?q?=20NPTL=20systems=20each=20line=20in=20the=20log=20file=20shows?= =?UTF-8?q?=20=20=20the=20individual=20thread's=20pid=20(based=20on=20a=20?= =?UTF-8?q?suggestion=20from=20Francois-Xavier=20Kowalski).=20-=20Fixed=20?= =?UTF-8?q?a=20problem=20with=20@plugin=20in=20keymacros.conf=20in=20case?= =?UTF-8?q?=20the=20named=20plugin=20is=20not=20=20=20loaded=20(reported?= =?UTF-8?q?=20by=20Franz=20Gangkofer).=20-=20Fixed=20a=20crash=20after=20e?= =?UTF-8?q?xecuting=20the=20SVDRP=20command=20CLRE,=20caused=20by=20dangli?= =?UTF-8?q?ng=20'schedule'=20=20=20pointers=20from=20cChannel=20objects=20?= =?UTF-8?q?(reported=20by=20Malte=20Schr=C3=B6der).=20-=20Updated=20the=20?= =?UTF-8?q?Finnish=20OSD=20texts=20(thanks=20to=20Rolf=20Ahrenberg).=20-?= =?UTF-8?q?=20Improved=20NULL=20checking=20in=20strreplace().=20-=20Fixed?= =?UTF-8?q?=20a=20crash=20in=20the=20Schedule=20menu=20with=20events=20tha?= =?UTF-8?q?t=20have=20no=20title=20(reported=20by=20=20=20Rolf=20Ahrenberg?= =?UTF-8?q?).=20cEvent::FixEpgBugs()=20now=20assigns=20a=20"No=20title"=20?= =?UTF-8?q?string=20to=20events=20=20=20that=20have=20no=20title.=20-=20Up?= =?UTF-8?q?dated=20the=20Estonian=20OSD=20texts=20(thanks=20to=20Arthur=20?= =?UTF-8?q?Konovalov).=20-=20Recordings=20are=20now=20only=20started=20if?= =?UTF-8?q?=20there=20is=20at=20least=20300MB=20free=20disk=20space=20=20?= =?UTF-8?q?=20(suggested=20by=20Markus=20Hahn).=20-=20When=20entering=20te?= =?UTF-8?q?xt=20via=20the=20numeric=20keys,=20the=20cursor=20now=20automat?= =?UTF-8?q?ically=20advances=20=20=20(based=20on=20a=20patch=20from=20Rolf?= =?UTF-8?q?=20Ahrenberg).=20-=20Updated=20the=20Polish=20OSD=20texts=20and?= =?UTF-8?q?=20the=20fontosd-iso8859-2.c=20file=20(thanks=20to=20Jaroslaw?= =?UTF-8?q?=20=20=20Swierczynski).=20-=20Disabled=20the=20"buffer=20reserv?= =?UTF-8?q?e"=20in=20Transfer=20Mode.=20Last=20chance=20to=20complain=20if?= =?UTF-8?q?=20you=20=20=20really=20need=20it=20-=20it=20will=20be=20comple?= =?UTF-8?q?tely=20removed=20in=20the=20next=20version.=20If=20you=20are=20?= =?UTF-8?q?=20=20experiencing=20problems=20with=20a/v=20running=20out=20of?= =?UTF-8?q?=20sync,=20try=20the=20latest=20driver=20and=20=20=20firmware?= =?UTF-8?q?=20(if=20you=20are=20using=20a=20full=20featured=20DVB=20card).?= =?UTF-8?q?=20-=20Switching=20channels=20with=20the=20Up/Down=20or=20Chann?= =?UTF-8?q?el+/Channel-=20keys=20now=20works=20a=20lot=20=20=20faster=20wh?= =?UTF-8?q?en=20the=20repeat=20function=20kicks=20in,=20by=20not=20actuall?= =?UTF-8?q?y=20switching=20the=20=20=20channel=20every=20time,=20but=20rat?= =?UTF-8?q?her=20only=20displaying=20the=20channel=20info=20and=20doing=20?= =?UTF-8?q?=20=20the=20final=20switch=20when=20the=20key=20is=20released.?= =?UTF-8?q?=20-=20The=20channel=20display=20is=20now=20updated=20=5Fbefore?= =?UTF-8?q?=5F=20the=20channel=20is=20switched.=20-=20Added=20a=20missing?= =?UTF-8?q?=20initialization=20of=20'timeout'=20in=20the=20cDisplayChannel?= =?UTF-8?q?=20constructor.=20-=20Fixed=20detecting=20if=20there=20can=20be?= =?UTF-8?q?=20any=20useful=20further=20input=20when=20entering=20channel?= =?UTF-8?q?=20=20=20numbers=20(thanks=20to=20Thomas=20Bergwinkl).=20-=20Up?= =?UTF-8?q?dated=20the=20Spanish=20OSD=20texts=20(thanks=20to=20Jesus=20Br?= =?UTF-8?q?avo=20Alvarez).=20-=20Fixed=20handling=20the=20'0'=20key=20for?= =?UTF-8?q?=20switching=20between=20the=20last=20two=20channels=20(thanks?= =?UTF-8?q?=20=20=20to=20Thomas=20Bergwinkl).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epg.c | 334 +++++++++++++++++++++++++++++++++--------------------------------- 1 file changed, 168 insertions(+), 166 deletions(-) (limited to 'epg.c') 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 and Rolf Hakenes . * - * $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; -- cgit v1.2.3