From 501ffe50086d7cd5559cbf4c31c150228236a88a Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sun, 17 Oct 2004 12:22:56 +0200 Subject: Removed the 'Log' parameter from the cChannel::Set... functions --- HISTORY | 2 ++ channels.c | 51 ++++++++++++++++++++++++++++----------------------- channels.h | 12 ++++++------ nit.c | 14 +++++++------- 4 files changed, 43 insertions(+), 36 deletions(-) diff --git a/HISTORY b/HISTORY index 53a94720..3d96de86 100644 --- a/HISTORY +++ b/HISTORY @@ -3033,3 +3033,5 @@ Video Disk Recorder Revision History lots of disk access due to automatic channel updates). Automatic channel modifications will be saved every 10 minutes if no recording is currently active. +- Removed the 'Log' parameter from the cChannel::Set... functions. Instead + checking if the channel has a non-zero number. diff --git a/channels.c b/channels.c index ba5fd8c1..ad3ca7fc 100644 --- a/channels.c +++ b/channels.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: channels.c 1.26 2004/10/17 11:21:39 kls Exp $ + * $Id: channels.c 1.27 2004/10/17 12:20:56 kls Exp $ */ #include "channels.h" @@ -261,7 +261,7 @@ int cChannel::Modification(int Mask) return Result; } -bool cChannel::SetSatTransponderData(int Source, int Frequency, char Polarization, int Srate, int CoderateH, bool Log) +bool cChannel::SetSatTransponderData(int Source, int Frequency, char Polarization, int Srate, int CoderateH) { // Workarounds for broadcaster stupidity: // Some providers broadcast the transponder frequency of their channels with two different @@ -273,41 +273,46 @@ bool cChannel::SetSatTransponderData(int Source, int Frequency, char Polarizatio return false; if (source != Source || frequency != Frequency || polarization != Polarization || srate != Srate || coderateH != CoderateH) { - if (Log) + if (Number()) { dsyslog("changing transponder data of channel %d from %s:%d:%c:%d:%d to %s:%d:%c:%d:%d", Number(), cSource::ToString(source), frequency, polarization, srate, coderateH, cSource::ToString(Source), Frequency, Polarization, Srate, CoderateH); + modification |= CHANNELMOD_TRANSP; + Channels.SetModified(); + } source = Source; frequency = Frequency; polarization = Polarization; srate = Srate; coderateH = CoderateH; modulation = QPSK; - modification |= CHANNELMOD_TRANSP; - Channels.SetModified(); } return true; } -bool cChannel::SetCableTransponderData(int Source, int Frequency, int Modulation, int Srate, int CoderateH, bool Log) +bool cChannel::SetCableTransponderData(int Source, int Frequency, int Modulation, int Srate, int CoderateH) { if (source != Source || frequency != Frequency || modulation != Modulation || srate != Srate || coderateH != CoderateH) { - if (Log) + if (Number()) { dsyslog("changing transponder data of channel %d from %s:%d:%d:%d:%d to %s:%d:%d:%d:%d", Number(), cSource::ToString(source), frequency, modulation, srate, coderateH, cSource::ToString(Source), Frequency, Modulation, Srate, CoderateH); + modification |= CHANNELMOD_TRANSP; + Channels.SetModified(); + } source = Source; frequency = Frequency; modulation = Modulation; srate = Srate; coderateH = CoderateH; - modification |= CHANNELMOD_TRANSP; - Channels.SetModified(); } return true; } -bool cChannel::SetTerrTransponderData(int Source, int Frequency, int Bandwidth, int Modulation, int Hierarchy, int CoderateH, int CoderateL, int Guard, int Transmission, bool Log) +bool cChannel::SetTerrTransponderData(int Source, int Frequency, int Bandwidth, int Modulation, int Hierarchy, int CoderateH, int CoderateL, int Guard, int Transmission) { if (source != Source || frequency != Frequency || bandwidth != Bandwidth || modulation != Modulation || hierarchy != Hierarchy || coderateH != CoderateH || coderateL != CoderateL || guard != Guard || transmission != Transmission) { - if (Log) + if (Number()) { dsyslog("changing transponder data of channel %d from %s:%d:%d:%d:%d:%d:%d:%d:%d to %s:%d:%d:%d:%d:%d:%d:%d:%d", Number(), cSource::ToString(source), frequency, bandwidth, modulation, hierarchy, coderateH, coderateL, guard, transmission, cSource::ToString(Source), Frequency, Bandwidth, Modulation, Hierarchy, CoderateH, CoderateL, Guard, Transmission); + modification |= CHANNELMOD_TRANSP; + Channels.SetModified(); + } source = Source; frequency = Frequency; bandwidth = Bandwidth; @@ -317,34 +322,34 @@ bool cChannel::SetTerrTransponderData(int Source, int Frequency, int Bandwidth, coderateL = CoderateL; guard = Guard; transmission = Transmission; - modification |= CHANNELMOD_TRANSP; - Channels.SetModified(); } return true; } -void cChannel::SetId(int Nid, int Tid, int Sid, int Rid, bool Log) +void cChannel::SetId(int Nid, int Tid, int Sid, int Rid) { if (nid != Nid || tid != Tid || sid != Sid || rid != Rid) { - if (Log) + if (Number()) { dsyslog("changing id of channel %d from %d-%d-%d-%d to %d-%d-%d-%d", Number(), nid, tid, sid, rid, Nid, Tid, Sid, Rid); + modification |= CHANNELMOD_ID; + Channels.SetModified(); + } nid = Nid; tid = Tid; sid = Sid; rid = Rid; - modification |= CHANNELMOD_ID; - Channels.SetModified(); } } -void cChannel::SetName(const char *Name, bool Log) +void cChannel::SetName(const char *Name) { if (!isempty(Name) && strcmp(name, Name) != 0) { - if (Log) + if (Number()) { dsyslog("changing name of channel %d from '%s' to '%s'", Number(), name, Name); + modification |= CHANNELMOD_NAME; + Channels.SetModified(); + } strn0cpy(name, Name, MaxChannelName); - modification |= CHANNELMOD_NAME; - Channels.SetModified(); } } @@ -880,10 +885,10 @@ cChannel *cChannels::NewChannel(const cChannel *Transponder, const char *Name, i if (Transponder) { dsyslog("creating new channel '%s' on %s transponder %d with id %d-%d-%d-%d", Name, cSource::ToString(Transponder->Source()), Transponder->Transponder(), Nid, Tid, Sid, Rid); cChannel *NewChannel = new cChannel(*Transponder); + NewChannel->SetId(Nid, Tid, Sid, Rid); + NewChannel->SetName(Name); Add(NewChannel); ReNumber(); - NewChannel->SetId(Nid, Tid, Sid, Rid, false); - NewChannel->SetName(Name, false); return NewChannel; } return NULL; diff --git a/channels.h b/channels.h index 23a8fa13..666e91b6 100644 --- a/channels.h +++ b/channels.h @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: channels.h 1.18 2004/10/17 10:33:38 kls Exp $ + * $Id: channels.h 1.19 2004/10/17 11:52:07 kls Exp $ */ #ifndef __CHANNELS_H @@ -167,11 +167,11 @@ public: bool IsTerr(void) const { return (source & cSource::st_Mask) == cSource::stTerr; } tChannelID GetChannelID(void) const; int Modification(int Mask = CHANNELMOD_ALL); - bool SetSatTransponderData(int Source, int Frequency, char Polarization, int Srate, int CoderateH, bool Log = true); - bool SetCableTransponderData(int Source, int Frequency, int Modulation, int Srate, int CoderateH, bool Log = true); - bool SetTerrTransponderData(int Source, int Frequency, int Bandwidth, int Modulation, int Hierarchy, int CodeRateH, int CodeRateL, int Guard, int Transmission, bool Log = true); - void SetId(int Nid, int Tid, int Sid, int Rid = 0, bool Log = true); - void SetName(const char *Name, bool Log = true); + bool SetSatTransponderData(int Source, int Frequency, char Polarization, int Srate, int CoderateH); + bool SetCableTransponderData(int Source, int Frequency, int Modulation, int Srate, int CoderateH); + bool SetTerrTransponderData(int Source, int Frequency, int Bandwidth, int Modulation, int Hierarchy, int CodeRateH, int CodeRateL, int Guard, int Transmission); + void SetId(int Nid, int Tid, int Sid, int Rid = 0); + void SetName(const char *Name); void SetPids(int Vpid, int Ppid, int *Apids, char ALangs[][4], int *Dpids, char DLangs[][4], int Tpid); void SetCaIds(const int *CaIds); // list must be zero-terminated void SetCaDescriptors(int Level); diff --git a/nit.c b/nit.c index 494d561d..73b1df24 100644 --- a/nit.c +++ b/nit.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: nit.c 1.9 2004/10/16 10:00:27 kls Exp $ + * $Id: nit.c 1.10 2004/10/17 12:00:54 kls Exp $ */ #include "nit.h" @@ -123,8 +123,8 @@ void cNitFilter::Process(u_short Pid, u_char Tid, const u_char *Data, int Length } if (!found && Setup.UpdateChannels >= 4) { cChannel *Channel = new cChannel; - Channel->SetId(ts.getOriginalNetworkId(), ts.getTransportStreamId(), 0, 0, false); - if (Channel->SetSatTransponderData(Source, Frequency, Polarization, SymbolRate, CodeRate, false)) + Channel->SetId(ts.getOriginalNetworkId(), ts.getTransportStreamId(), 0, 0); + if (Channel->SetSatTransponderData(Source, Frequency, Polarization, SymbolRate, CodeRate)) EITScanner.AddTransponder(Channel); else delete Channel; @@ -158,8 +158,8 @@ void cNitFilter::Process(u_short Pid, u_char Tid, const u_char *Data, int Length } if (!found && Setup.UpdateChannels >= 4) { cChannel *Channel = new cChannel; - Channel->SetId(ts.getOriginalNetworkId(), ts.getTransportStreamId(), 0, 0, false); - if (Channel->SetCableTransponderData(Source, Frequency, Modulation, SymbolRate, CodeRate, false)) + Channel->SetId(ts.getOriginalNetworkId(), ts.getTransportStreamId(), 0, 0); + if (Channel->SetCableTransponderData(Source, Frequency, Modulation, SymbolRate, CodeRate)) EITScanner.AddTransponder(Channel); else delete Channel; @@ -200,8 +200,8 @@ void cNitFilter::Process(u_short Pid, u_char Tid, const u_char *Data, int Length } if (!found && Setup.UpdateChannels >= 4) { cChannel *Channel = new cChannel; - Channel->SetId(ts.getOriginalNetworkId(), ts.getTransportStreamId(), 0, 0, false); - if (Channel->SetTerrTransponderData(Source, Frequency, Bandwidth, Constellation, Hierarchy, CodeRateHP, CodeRateLP, GuardInterval, TransmissionMode, false)) + Channel->SetId(ts.getOriginalNetworkId(), ts.getTransportStreamId(), 0, 0); + if (Channel->SetTerrTransponderData(Source, Frequency, Bandwidth, Constellation, Hierarchy, CodeRateHP, CodeRateLP, GuardInterval, TransmissionMode)) EITScanner.AddTransponder(Channel); else delete Channel; -- cgit v1.2.3