summaryrefslogtreecommitdiff
path: root/channels.c
diff options
context:
space:
mode:
Diffstat (limited to 'channels.c')
-rw-r--r--channels.c53
1 files changed, 30 insertions, 23 deletions
diff --git a/channels.c b/channels.c
index b2d741e..8577852 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.42 2005/05/29 10:32:38 kls Exp $
+ * $Id: channels.c 1.44 2005/08/06 12:22:41 kls Exp $
*/
#include "channels.h"
@@ -179,27 +179,13 @@ cChannel::cChannel(void)
cChannel::cChannel(const cChannel &Channel)
{
- name = strdup("");
- shortName = strdup("");
- provider = strdup("");
- portalName = strdup("");
- *this = Channel;
- vpid = 0;
- ppid = 0;
- apids[0] = 0;
- dpids[0] = 0;
- spids[0] = 0;
- tpid = 0;
- caids[0] = 0;
- nid = 0;
- tid = 0;
- sid = 0;
- rid = 0;
- number = 0;
- groupSep = false;
- modification = CHANNELMOD_NONE;
+ name = NULL;
+ shortName = NULL;
+ provider = NULL;
+ portalName = NULL;
linkChannels = NULL;
refChannel = NULL;
+ *this = Channel;
}
cChannel::~cChannel()
@@ -265,6 +251,24 @@ int cChannel::Modification(int Mask)
return Result;
}
+void cChannel::CopyTransponderData(const cChannel *Channel)
+{
+ if (Channel) {
+ frequency = Channel->frequency;
+ source = Channel->source;
+ srate = Channel->srate;
+ polarization = Channel->polarization;
+ inversion = Channel->inversion;
+ bandwidth = Channel->bandwidth;
+ coderateH = Channel->coderateH;
+ coderateL = Channel->coderateL;
+ modulation = Channel->modulation;
+ transmission = Channel->transmission;
+ guard = Channel->guard;
+ hierarchy = Channel->hierarchy;
+ }
+}
+
bool cChannel::SetSatTransponderData(int Source, int Frequency, char Polarization, int Srate, int CoderateH)
{
// Workarounds for broadcaster stupidity:
@@ -442,14 +446,16 @@ void cChannel::SetPids(int Vpid, int Ppid, int *Apids, char ALangs[][4], int *Dp
dsyslog("changing pids of channel %d from %d+%d:%s:%d to %d+%d:%s:%d", Number(), vpid, ppid, OldApidsBuf, tpid, Vpid, Ppid, NewApidsBuf, Tpid);
vpid = Vpid;
ppid = Ppid;
- for (int i = 0; i <= MAXAPIDS; i++) { // <= to copy the terminating 0
+ for (int i = 0; i < MAXAPIDS; i++) {
apids[i] = Apids[i];
strn0cpy(alangs[i], ALangs[i], 4);
}
- for (int i = 0; i <= MAXDPIDS; i++) { // <= to copy the terminating 0
+ apids[MAXAPIDS] = 0;
+ for (int i = 0; i < MAXDPIDS; i++) {
dpids[i] = Dpids[i];
strn0cpy(dlangs[i], DLangs[i], 4);
}
+ dpids[MAXDPIDS] = 0;
tpid = Tpid;
modification |= mod;
Channels.SetModified();
@@ -977,7 +983,8 @@ cChannel *cChannels::NewChannel(const cChannel *Transponder, const char *Name, c
{
if (Transponder) {
dsyslog("creating new channel '%s,%s;%s' on %s transponder %d with id %d-%d-%d-%d", Name, ShortName, Provider, *cSource::ToString(Transponder->Source()), Transponder->Transponder(), Nid, Tid, Sid, Rid);
- cChannel *NewChannel = new cChannel(*Transponder);
+ cChannel *NewChannel = new cChannel;
+ NewChannel->CopyTransponderData(Transponder);
NewChannel->SetId(Nid, Tid, Sid, Rid);
NewChannel->SetName(Name, ShortName, Provider);
Add(NewChannel);