1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00

Removed the 'Log' parameter from the cChannel::Set... functions

This commit is contained in:
Klaus Schmidinger 2004-10-17 12:22:56 +02:00
parent 30dfd2e701
commit 501ffe5008
4 changed files with 43 additions and 36 deletions

View File

@ -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.

View File

@ -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;

View File

@ -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);

14
nit.c
View File

@ -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;