diff options
author | austriancoder <austriancoder> | 2005-01-10 15:58:13 +0000 |
---|---|---|
committer | austriancoder <austriancoder> | 2005-01-10 15:58:13 +0000 |
commit | c765bc2f70c89a169c17dff980b92a6dd1b1e851 (patch) | |
tree | 757dc40e8e92741d8fe851d1d4ee175bf7a0e0f6 | |
parent | 0513b6d4fac0f2be74b95fa06e52ee19f7f399c7 (diff) | |
download | vdr-plugin-dxr3-c765bc2f70c89a169c17dff980b92a6dd1b1e851.tar.gz vdr-plugin-dxr3-c765bc2f70c89a169c17dff980b92a6dd1b1e851.tar.bz2 |
fix for gcc 3.4.x compilers
-rw-r--r-- | HISTORY | 4 | ||||
-rw-r--r-- | dxr3syncbuffer.c | 38 | ||||
-rw-r--r-- | dxr3syncbuffer.h | 4 |
3 files changed, 32 insertions, 14 deletions
@@ -230,7 +230,7 @@ NOTE: I havent found time to include all of the languages, will be done in pre2 - fixed dxr3osd_subpicutre.c - thanks to Paavo Hartikainen <pahartik@sci.fi> -2004-??-??: Version 0.2.3-pre3 +2005-??-??: Version 0.2.3-pre3 - fixed output of anamorphic video, if tv aspect is configured to 16:9 in DVB setup menu thanks Seppo Ingalsuo <seppo.ingalsuo@iki.fi> @@ -272,3 +272,5 @@ NOTE: I havent found time to include all of the languages, will be done in pre2 - added a small patch, containing mainly Finnish translation updates but also a few other small ones thanks Ville Skyta <ville.skytta@iki.fi> - some little fixes in the dx3interface: if we cant open control fifo plugins retuns now correct error message +- removed -lz from makefile +- compiles now with 3.4.x gcc's diff --git a/dxr3syncbuffer.c b/dxr3syncbuffer.c index 7bf6932..f2fe80f 100644 --- a/dxr3syncbuffer.c +++ b/dxr3syncbuffer.c @@ -33,15 +33,8 @@ const int DXR3_MAX_AUDIO_FRAME_LENGTH = 4096; // ================================== //! constructor -cFixedLengthFrame::cFixedLengthFrame(uint32_t length) : -m_count(0), m_length(length), m_pts(0), m_type(ftUnknown) { - - m_pData = new uint8_t[length]; - if (!m_pData) - { - cLog::Instance() << "Failed to allocate memory in cFixedLengthFrame (m_pData) - will stop now"; - exit(1); - } +cFixedLengthFrame::cFixedLengthFrame() : +m_count(0), m_length(0), m_pts(0), m_type(ftUnknown) { m_audioChannelCount = UNKNOWN_CHANNEL_COUNT; m_audioDataRate = UNKNOWN_DATA_RATE; @@ -58,6 +51,21 @@ cFixedLengthFrame::~cFixedLengthFrame() } // ================================== +// ! setup our frame +void cFixedLengthFrame::Init(uint32_t lenght) +{ + m_length = length; + m_pData = new uint8_t[length]; + + // allocation ok? + if (!m_pData) + { + cLog::Instance() << "Failed to allocate memory in cFixedLengthFrame (m_pData) - will stop now"; + exit(1); + } +} + +// ================================== void cFixedLengthFrame::CopyFrame(const uint8_t* pStart, int length, uint32_t pts, eFrameType type) { if (length > m_length) @@ -101,20 +109,26 @@ uint32_t cFixedLengthFrame::m_staticAudioChannelCount = 0; uint32_t cFixedLengthFrame::m_staticAudioDataRate = 0; - - // ================================== //! constructor cDxr3SyncBuffer::cDxr3SyncBuffer(int frameCount, int frameLength, cDxr3Interface& dxr3Device) : cRingBuffer(frameCount, true), m_dxr3Device(dxr3Device) { - m_pBuffer = new cFixedLengthFrame[frameCount](frameLength); + m_pBuffer = new cFixedLengthFrame[frameCount]; + // got we a valid m_pBuffer? if (!m_pBuffer) { cLog::Instance() << "Failed to allocate memory in cDxr3SyncBuffer (m_pBuffer) - will stop now"; exit(1); } + // init our new m_pBuffer; + for (int i = 0; i < frameCount; i++) + { + m_pBuffer[i].Init(frameLenght); + } + + // set some default values m_count = 0; m_nextFree = 0; m_next = 0; diff --git a/dxr3syncbuffer.h b/dxr3syncbuffer.h index 21b495b..3ae5cc9 100644 --- a/dxr3syncbuffer.h +++ b/dxr3syncbuffer.h @@ -39,9 +39,11 @@ const uint32_t UNKNOWN_ASPECT_RATIO = 0xFFFFFFFF; class cFixedLengthFrame { public: - explicit cFixedLengthFrame(uint32_t length); + explicit cFixedLengthFrame(); ~cFixedLengthFrame(); + void Init(uint32_t lenght); + void CopyFrame(const uint8_t* pStart, int length, uint32_t pts, eFrameType type); uint8_t* GetData(void); int GetCount(void); |