From e8963264e996cfc4ce7938a7198cefe36cf1e5a3 Mon Sep 17 00:00:00 2001 From: Dmytro Bogovych Date: Thu, 14 Mar 2019 11:37:49 +0200 Subject: [PATCH] - fix potential problems with builds - size of some structures depends on #define in projects. But #define can be different for app and library (for example) - it will result in strange crashes. Fixed. --- src/engine/helper/HL_Rtp.h | 6 +----- src/engine/helper/HL_Uuid.h | 5 +++++ src/engine/media/MT_Statistics.cpp | 3 --- src/engine/media/MT_Statistics.h | 3 +-- 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/engine/helper/HL_Rtp.h b/src/engine/helper/HL_Rtp.h index 0e518ade..a2600b81 100644 --- a/src/engine/helper/HL_Rtp.h +++ b/src/engine/helper/HL_Rtp.h @@ -10,9 +10,7 @@ # include "jrtplib/src/rtppacket.h" #endif -#if !defined(USE_NULL_UUID) -# include "HL_Uuid.h" -#endif +#include "HL_Uuid.h" #include "HL_InternetAddress.h" @@ -82,9 +80,7 @@ struct MediaStreamId InternetAddress mDestination; uint32_t mSSRC = 0; bool mSsrcIsId = true; -#if !defined(USE_NULL_UUID) Uuid mLinkId; -#endif bool operator < (const MediaStreamId& s2) const; bool operator == (const MediaStreamId& right) const; diff --git a/src/engine/helper/HL_Uuid.h b/src/engine/helper/HL_Uuid.h index 8d977bb9..19abcb46 100644 --- a/src/engine/helper/HL_Uuid.h +++ b/src/engine/helper/HL_Uuid.h @@ -20,6 +20,10 @@ public: bool operator < (const Uuid& right) const; protected: +#if defined(USE_NULL_UUID) + unsigned char mUuid[16]; +#else + #if defined(TARGET_LINUX) || defined(TARGET_OSX) uuid_t mUuid; #endif @@ -29,6 +33,7 @@ protected: #if defined(TARGET_ANDROID) // Stub only #endif +#endif }; diff --git a/src/engine/media/MT_Statistics.cpp b/src/engine/media/MT_Statistics.cpp index 0d9a8307..3fead622 100644 --- a/src/engine/media/MT_Statistics.cpp +++ b/src/engine/media/MT_Statistics.cpp @@ -69,10 +69,7 @@ Statistics::Statistics() mReceivedRtcp(0), mSentRtcp(0), mDuplicatedRtp(0), mOldRtp(0), mIllegalRtp(0), mPacketLoss(0), mJitter(0.0), mAudioTime(0), mSsrc(0) { -#if defined(USE_AMR_CODEC) mBitrateSwitchCounter = 0; -#endif - memset(mLoss, 0, sizeof mLoss); // It is to keep track of statistics instance via grep | wc -l diff --git a/src/engine/media/MT_Statistics.h b/src/engine/media/MT_Statistics.h index 4dc3b484..9c82ec15 100644 --- a/src/engine/media/MT_Statistics.h +++ b/src/engine/media/MT_Statistics.h @@ -117,9 +117,8 @@ public: uint16_t mSsrc; // Last known SSRC ID in a RTP stream ice::NetworkAddress mRemotePeer; // Last known remote RTP address -#if defined(USE_AMR_CODEC) + // AMR codec bitrate switch counter int mBitrateSwitchCounter; -#endif std::string mCodecName;