Failed to read channels.conf after adding transponder

Message ID 485921E2.1@pec.homeip.net
State New
Headers

Commit Message

Peter Evertz June 18, 2008, 2:55 p.m. UTC
  Tim schrieb:
> Am Mittwoch 18 Juni 2008 schrieb Frank Scherthan:
>   
>> Hi
>>
>> Hanno Zulla schrieb:
>>     
>>>> Is there an easy fix I could test right now? Can I disable the
>>>> channel-checking?
>>>>         
>>> Yes, you can. Check the DVB settings menu.
>>>       
>> You are wrong. I am not talking about *updating channels*.
>> I know about that and as a workaround, I switched it off.
>> BUT:
>> This is NOT what I am looking for.
>>
>> I want to disable the check, for invalid channels in channels.conf
>> I just don't care, if a channel is not "tuneable".
>>     
> in config.h, in the function "bool Load()" at about line 123 (vdr 1.4.7) 
> uncomment 2 lines:
>                    else {
>                       esyslog("ERROR: error in %s, line %d", fileName, line);
>                       delete l;
>                       //RC: we do not want to exit vdr just because of a 
> simple error
>                       //result = false;
>                       //break;
>                       }
>                    }
>                 }
> this will cause vdr to go on starting even if an error accours in a config 
> file and increase waf. ;)
>   
It happens again today. So I made a quick fix.

Are you sure that your fix will increase the WAF ? I don't know if VDR 
works correctly with a "broken" channels list.

I prefer not to add broken channels.  The patch does not help for 
channels that modify pids to a broken state, but prevents to add broken 
channels.
  

Comments

rollercoaster@reel-multimedia.com June 19, 2008, 7:38 a.m. UTC | #1
Am Mittwoch 18 Juni 2008 schrieb Peter Evertz:

> >> I want to disable the check, for invalid channels in channels.conf
> >> I just don't care, if a channel is not "tuneable".
> >
> > in config.h, in the function "bool Load()" at about line 123 (vdr 1.4.7)
> > uncomment 2 lines:
> >                    else {
> >                       esyslog("ERROR: error in %s, line %d", fileName,
> > line); delete l;
> >                       //RC: we do not want to exit vdr just because of a
> > simple error
> >                       //result = false;
> >                       //break;
> >                       }
> >                    }
> >                 }
> > this will cause vdr to go on starting even if an error accours in a
> > config file and increase waf. ;)
> Are you sure that your fix will increase the WAF ? I don't know if VDR
> works correctly with a "broken" channels list.
It is not broken, as the questionable entry is deleted again (delete l;) when 
parsing it. So happens for all configuration files. You can do 
a 'cat /dev/random > /etc/vdr/channels.conf' and the vdr still comes up.
This way it is prevented that the vdr hangs inside a boot-loop. 


cu, tim
  
Peter Evertz June 19, 2008, 1:43 p.m. UTC | #2
Tim schrieb:
> Am Mittwoch 18 Juni 2008 schrieb Peter Evertz:
>
>   
>>>> I want to disable the check, for invalid channels in channels.conf
>>>> I just don't care, if a channel is not "tuneable".
>>>>         
>>> in config.h, in the function "bool Load()" at about line 123 (vdr 1.4.7)
>>> uncomment 2 lines:
>>>                    else {
>>>                       esyslog("ERROR: error in %s, line %d", fileName,
>>> line); delete l;
>>>                       //RC: we do not want to exit vdr just because of a
>>> simple error
>>>                       //result = false;
>>>                       //break;
>>>                       }
>>>                    }
>>>                 }
>>> this will cause vdr to go on starting even if an error accours in a
>>> config file and increase waf. ;)
>>>       
>> Are you sure that your fix will increase the WAF ? I don't know if VDR
>> works correctly with a "broken" channels list.
>>     
> It is not broken, as the questionable entry is deleted again (delete l;) when 
> parsing it. So happens for all configuration files. You can do 
> a 'cat /dev/random > /etc/vdr/channels.conf' and the vdr still comes up.
> This way it is prevented that the vdr hangs inside a boot-loop. 
>   
You are right. I did not see the delete statement. I thought you have 
only removed the check, resulting in a channel list with "invalid" entries.

Bye
Peter
  

Patch

--- channels.c.org      2008-04-12 15:49:12.000000000 +0200
+++ channels.c  2008-06-18 12:20:17.000000000 +0200
@@ -1151,6 +1151,11 @@ 
      NewChannel->CopyTransponderData(Transponder);
      NewChannel->SetId(Nid, Tid, Sid, Rid);
      NewChannel->SetName(Name, ShortName, Provider);
+     if(! NewChannel->GetChannelID().Valid()) {
+        esyslog("ERROR: new channel data results in invalid ID!");
+        free(NewChannel);
+        return(NULL);
+     }
      Add(NewChannel);
      ReNumber();
      return NewChannel;