summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2005-08-06 12:13:55 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2005-08-06 12:13:55 +0200
commitff5df8f29852a1c968a2797e13e494ae882bed26 (patch)
treeff44d8420a562fd9fe6f2deb325c01d1ba4975b6
parentbc22ed879c05836e0f1d5e40f0f4a052d1f9d511 (diff)
downloadvdr-ff5df8f29852a1c968a2797e13e494ae882bed26.tar.gz
vdr-ff5df8f29852a1c968a2797e13e494ae882bed26.tar.bz2
Fixed the cChannel copy constructor
-rw-r--r--CONTRIBUTORS1
-rw-r--r--HISTORY2
-rw-r--r--channels.c47
-rw-r--r--channels.h3
4 files changed, 31 insertions, 22 deletions
diff --git a/CONTRIBUTORS b/CONTRIBUTORS
index 7f222839..349d70de 100644
--- a/CONTRIBUTORS
+++ b/CONTRIBUTORS
@@ -731,6 +731,7 @@ Marcel Wiesweg <marcel.wiesweg@gmx.de>
for adding a few missing initializations
for adding play mode pmVideoOnly
for fixing a possible crash with inconsistent SI data
+ for pointing out a problem with the cChannel copy constructor
Torsten Herz <torsten.herz@web.de>
for fixing a possible deadlock when using the "Blue" button in the "Schedules" menu
diff --git a/HISTORY b/HISTORY
index 600b83c4..6a3b25fd 100644
--- a/HISTORY
+++ b/HISTORY
@@ -3655,3 +3655,5 @@ Video Disk Recorder Revision History
problem with this).
- Files and directories are now created with rights according to the shell's
umask settings (thanks to Andreas Brachold).
+- Fixed the cChannel copy constructor (thanks to Marcel Wiesweg for pointing out
+ a problem with it).
diff --git a/channels.c b/channels.c
index b2d741e6..04f6dc98 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.43 2005/08/06 12:06:37 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:
@@ -977,7 +981,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);
diff --git a/channels.h b/channels.h
index 3cb7e8f8..53720424 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.32 2005/05/28 13:57:08 kls Exp $
+ * $Id: channels.h 1.33 2005/08/06 11:23:32 kls Exp $
*/
#ifndef __CHANNELS_H
@@ -181,6 +181,7 @@ public:
bool IsTerr(void) const { return cSource::IsTerr(source); }
tChannelID GetChannelID(void) const { return tChannelID(source, nid, (nid || tid) ? tid : Transponder(), sid, rid); }
int Modification(int Mask = CHANNELMOD_ALL);
+ void CopyTransponderData(const cChannel *Channel);
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);