Null titles and cSchedule::GetFollowingEvent

Message ID ECOWS04MJd1NOcEExUH00039a77@smtp-out4.blueyonder.co.uk
State New
Headers

Commit Message

Chris Warren Feb. 13, 2005, 1:48 p.m. UTC
  Hi all,
 
I notice that quite often EPG data contains events with null or empty
titles. These tend to be 'gaps' between programs (especially on movie
channels.) Would it be sensible to skip over these when showing the "Whats
on Next?" screen?

Looking at the code, the place that needs changed is
cSchedule::GetFollowingEvent in epg.c.

Apart from cMenuWhatsOn::cMenuWhatsOn in menu.c, the only other place place
this is called from is cSchedule::Dump - would the following patch (attached
and included below) cause any problems? I've been running it for a few days
and it seems ok.

Or would it be better to make the change to cMenuWhatsOn::cMenuWhatsOn?

Chris
  

Comments

matthieu castet Feb. 13, 2005, 9:23 p.m. UTC | #1
Selon Chris Warren <dvb@ixalon.net>:

> Hi all,
>
> I notice that quite often EPG data contains events with null or empty
> titles. These tend to be 'gaps' between programs (especially on movie
> channels.) Would it be sensible to skip over these when showing the "Whats
> on Next?" screen?
>
I even think we shouldn't display it because they are annoying...


Matthieu
  
Jan Ekholm Feb. 14, 2005, 7:34 a.m. UTC | #2
On Sun, 13 Feb 2005 castet.matthieu@free.fr wrote:

>Selon Chris Warren <dvb@ixalon.net>:
>
>> Hi all,
>>
>> I notice that quite often EPG data contains events with null or empty
>> titles. These tend to be 'gaps' between programs (especially on movie
>> channels.) Would it be sensible to skip over these when showing the "Whats
>> on Next?" screen?
>>
>I even think we shouldn't display it because they are annoying...

I quite often see programs named (null) in the EPG list. It probably means
that VDR has taken a NULL title and sprintf():ed it into a string that
gets displayes, and the NULL has been replaced with the string "(null)".
Seems to happen after a restart where some ongoing program can't be found
anymore or for "something" that is shown between 00:00 and 06:00. VDR
doesn't crash when viewing more detailed infofor these events, there just
isn't any extra info available. So it's more of a cosmetic issue.
  

Patch

--- vdr-1.3.20/epg.c    2005-01-02 11:25:25.000000000 +0000
+++ vdr-1.3.20-modified/epg.c   2005-02-11 20:26:10.000000000 +0000
@@ -672,8 +672,14 @@  const cEvent *cSchedule::GetPresentEvent
 const cEvent *cSchedule::GetFollowingEvent(bool CheckRunningStatus) const
 {
   const cEvent *p = GetPresentEvent(CheckRunningStatus);
-  if (p)
+  if (p) {
      p = events.Next(p);
+
+     const cEvent *tempp = p;
+     while(tempp && ((tempp->Title() == NULL) ||
(strlen(tempp->Title())==0))) tempp = events.Next(tempp);
+     if(tempp)
+        return tempp;
+  }
   return p;
 }