diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2015-09-05 11:49:56 +0200 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2015-09-05 11:49:56 +0200 |
commit | 50d268538ee714e8e3f88bba0e952c33a75d3777 (patch) | |
tree | c6e20605a33ea719c4d491a77bcb67928c785305 | |
parent | 3cd5294d8a337ee5cd2ec894c9fbe04ad3a7690d (diff) | |
download | vdr-50d268538ee714e8e3f88bba0e952c33a75d3777.tar.gz vdr-50d268538ee714e8e3f88bba0e952c33a75d3777.tar.bz2 |
Added a missing 'const' to cReceiver::Receive(), to protect the given Data from being modified
-rw-r--r-- | HISTORY | 4 | ||||
-rw-r--r-- | ci.c | 14 | ||||
-rw-r--r-- | device.c | 6 | ||||
-rw-r--r-- | receiver.h | 4 | ||||
-rw-r--r-- | recorder.c | 4 | ||||
-rw-r--r-- | recorder.h | 4 | ||||
-rw-r--r-- | transfer.c | 4 | ||||
-rw-r--r-- | transfer.h | 4 |
8 files changed, 23 insertions, 21 deletions
@@ -8596,7 +8596,7 @@ Video Disk Recorder Revision History - Bumped all version numbers to 2.2.0. - Official release. -2015-09-01: Version 2.3.1 +2015-09-05: Version 2.3.1 - The new function cOsd::MaxPixmapSize() can be called to determine the maximum size a cPixmap may have on the current OSD. The 'osddemo' example has been modified @@ -8782,3 +8782,5 @@ Video Disk Recorder Revision History connections to trigger fetching remote timers. - You can now set DumpSVDRPDataTransfer in svdrp.c to true to have all SVDRP communication printed to the console for debugging. +- Added a missing 'const' to cReceiver::Receive(), to protect the given Data from + being modified. @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: ci.c 4.1 2015/07/18 09:57:42 kls Exp $ + * $Id: ci.c 4.2 2015/09/05 11:45:19 kls Exp $ */ #include "ci.h" @@ -125,8 +125,8 @@ protected: public: cCaPidReceiver(void); virtual ~cCaPidReceiver() { Detach(); } - virtual void Receive(uchar *Data, int Length); - bool HasCaPids(void) { return NumPids() - emmPids.Size() - 1 > 0; } + virtual void Receive(const uchar *Data, int Length); + bool HasCaPids(void) const { return NumPids() - emmPids.Size() - 1 > 0; } void Reset(void) { DelEmmPids(); catVersion = -1; } }; @@ -160,10 +160,10 @@ void cCaPidReceiver::Activate(bool On) catVersion = -1; // can be done independent of 'On' } -void cCaPidReceiver::Receive(uchar *Data, int Length) +void cCaPidReceiver::Receive(const uchar *Data, int Length) { if (TsPid(Data) == CATPID) { - uchar *p = NULL; + const uchar *p = NULL; if (TsPayloadStart(Data)) { if (Data[5] == SI::TableIdCAT) { length = (int(Data[6] & 0x03) << 8) | Data[7]; // section length @@ -251,7 +251,7 @@ private: time_t lastScrambledTime; int numTsPackets; protected: - virtual void Receive(uchar *Data, int Length); + virtual void Receive(const uchar *Data, int Length); public: cCaActivationReceiver(const cChannel *Channel, cCamSlot *CamSlot); virtual ~cCaActivationReceiver(); @@ -270,7 +270,7 @@ cCaActivationReceiver::~cCaActivationReceiver() Detach(); } -void cCaActivationReceiver::Receive(uchar *Data, int Length) +void cCaActivationReceiver::Receive(const uchar *Data, int Length) { if (numTsPackets++ % TS_PACKET_FACTOR == 0) { time_t Now = time(NULL); @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: device.c 4.1 2015/08/29 12:41:08 kls Exp $ + * $Id: device.c 4.2 2015/09/05 11:42:17 kls Exp $ */ #include "device.h" @@ -24,7 +24,7 @@ class cLiveSubtitle : public cReceiver { protected: - virtual void Receive(uchar *Data, int Length); + virtual void Receive(const uchar *Data, int Length); public: cLiveSubtitle(int SPid); virtual ~cLiveSubtitle(); @@ -40,7 +40,7 @@ cLiveSubtitle::~cLiveSubtitle() cReceiver::Detach(); } -void cLiveSubtitle::Receive(uchar *Data, int Length) +void cLiveSubtitle::Receive(const uchar *Data, int Length) { if (cDevice::PrimaryDevice()) cDevice::PrimaryDevice()->PlayTs(Data, Length); @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: receiver.h 3.3 2015/01/12 14:03:22 kls Exp $ + * $Id: receiver.h 4.1 2015/09/05 11:42:47 kls Exp $ */ #ifndef __RECEIVER_H @@ -31,7 +31,7 @@ protected: ///< (On == true) and right after it gets detached from (On == false) a cDevice. It can be used ///< to do things like starting/stopping a thread. ///< It is guaranteed that Receive() will not be called before Activate(true). - virtual void Receive(uchar *Data, int Length) = 0; + virtual void Receive(const uchar *Data, int Length) = 0; ///< This function is called from the cDevice we are attached to, and ///< delivers one TS packet from the set of PIDs the cReceiver has requested. ///< The data packet must be accepted immediately, and the call must return @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: recorder.c 4.1 2015/08/03 10:23:35 kls Exp $ + * $Id: recorder.c 4.2 2015/09/05 11:43:51 kls Exp $ */ #include "recorder.h" @@ -106,7 +106,7 @@ void cRecorder::Activate(bool On) Cancel(3); } -void cRecorder::Receive(uchar *Data, int Length) +void cRecorder::Receive(const uchar *Data, int Length) { if (Running()) { int p = ringBuffer->Put(Data, Length); @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: recorder.h 3.1 2015/01/15 14:27:02 kls Exp $ + * $Id: recorder.h 4.1 2015/09/05 11:46:23 kls Exp $ */ #ifndef __RECORDER_H @@ -35,7 +35,7 @@ protected: ///< member of the cReceiver class) from your own destructor in order ///< to properly get a call to Activate(false) when your object is ///< destroyed. - virtual void Receive(uchar *Data, int Length); + virtual void Receive(const uchar *Data, int Length); virtual void Action(void); public: cRecorder(const char *FileName, const cChannel *Channel, int Priority); @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: transfer.c 3.1 2013/08/22 12:33:02 kls Exp $ + * $Id: transfer.c 4.1 2015/09/05 11:43:58 kls Exp $ */ #include "transfer.h" @@ -38,7 +38,7 @@ void cTransfer::Activate(bool On) #define MAXRETRIES 20 // max. number of retries for a single TS packet #define RETRYWAIT 5 // time (in ms) between two retries -void cTransfer::Receive(uchar *Data, int Length) +void cTransfer::Receive(const uchar *Data, int Length) { if (cPlayer::IsAttached()) { // Transfer Mode means "live tv", so there's no point in doing any additional @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: transfer.h 2.4 2013/03/01 09:49:46 kls Exp $ + * $Id: transfer.h 4.1 2015/09/05 11:43:08 kls Exp $ */ #ifndef __TRANSFER_H @@ -19,7 +19,7 @@ private: cPatPmtGenerator patPmtGenerator; protected: virtual void Activate(bool On); - virtual void Receive(uchar *Data, int Length); + virtual void Receive(const uchar *Data, int Length); public: cTransfer(const cChannel *Channel); virtual ~cTransfer(); |