diff --git a/orkaudio/configure.in b/orkaudio/configure.in index cc62f50..5d8f059 100644 --- a/orkaudio/configure.in +++ b/orkaudio/configure.in @@ -10,6 +10,11 @@ if [cat /etc/issue | grep Ubuntu]; then CXXFLAGS+="-std=c++11" fi +if [ grep -i opensuse /etc/os-release ]; then + speex_lib=speex + CXXFLAGS+="-std=c++11" +fi + if [grep "release 5" /etc/redhat-release]; then CXXFLAGS+="-DCENTOS_5" fi diff --git a/orkaudio/filters/silkcodec/SilkCodec.cpp b/orkaudio/filters/silkcodec/SilkCodec.cpp index af84303..2f320fb 100644 --- a/orkaudio/filters/silkcodec/SilkCodec.cpp +++ b/orkaudio/filters/silkcodec/SilkCodec.cpp @@ -124,7 +124,9 @@ void SilkCodecDecoder::AudioChunkIn(AudioChunkRef& inputAudioChunk) } } - else if(abs(outputDetails.m_timestamp - m_lastRtpTs) != (abs(outputDetails.m_sequenceNumber - m_lastRtpSeq) *m_sampleRate8KhzMultiplier*160)) + // cast timestamps to long so that we can take difference of unsigned ints + else if(abs((long)outputDetails.m_timestamp - (long)m_lastRtpTs) != + (abs((long)outputDetails.m_sequenceNumber - (long)m_lastRtpSeq) *m_sampleRate8KhzMultiplier*160)) { // sequence number delta is not coherent with timestamp delta, recalculating m_sampleRate8KhzMultiplier. //Using abs() in the condition to make sure that out of order packets will not trigger this and cause one additional unecessary lost packet diff --git a/orkbasecxx/ConfigManager.cpp b/orkbasecxx/ConfigManager.cpp index 41c3369..ccaceec 100644 --- a/orkbasecxx/ConfigManager.cpp +++ b/orkbasecxx/ConfigManager.cpp @@ -18,7 +18,6 @@ #include #include #include -#include #include #include #include "serializers/DomSerializer.h" diff --git a/orkbasecxx/MultiThreadedServer.cpp b/orkbasecxx/MultiThreadedServer.cpp index 32561e0..c3cde26 100644 --- a/orkbasecxx/MultiThreadedServer.cpp +++ b/orkbasecxx/MultiThreadedServer.cpp @@ -17,7 +17,6 @@ //#include "winsock2.h" #endif #include -#include #include #include diff --git a/orkbasecxx/configure.in b/orkbasecxx/configure.in index 2143f14..cc7c7d8 100644 --- a/orkbasecxx/configure.in +++ b/orkbasecxx/configure.in @@ -9,8 +9,12 @@ if [cat /etc/redhat-release | grep "release 6"]; then CXXFLAGS+="-DCENTOS_6 -D__STDC_CONSTANT_MACROS" fi +if [grep -i "opensuse" /etc/os-release]; then + CXXFLAGS+="-std=c++11 -DXERCES_3" +fi + if [cat /etc/issue | grep "Ubuntu"]; then - CXXFLAGS+="-std=c++11" + CXXFLAGS+="-std=c++11 -DXERCES_3" fi # Check if gcc supports cpp11 diff --git a/orkbasecxx/serializers/DomSerializer.cpp b/orkbasecxx/serializers/DomSerializer.cpp index a91d11d..def2f9d 100644 --- a/orkbasecxx/serializers/DomSerializer.cpp +++ b/orkbasecxx/serializers/DomSerializer.cpp @@ -17,7 +17,11 @@ #include #include #include +#ifdef XERCES_3 +#include +#else #include +#endif #include #include "DomSerializer.h" @@ -187,6 +191,31 @@ DOMNode* DomSerializer::FindElementByName(DOMNode *node, CStdString name) return NULL; } +#ifdef XERCES_3 +CStdString DomSerializer::DomNodeToString(DOMNode* node) +{ + CStdString output; + DOMImplementation *impl = DOMImplementationRegistry::getDOMImplementation(XStr("LS").unicodeForm()); + DOMLSSerializer* theSerializer = ((DOMImplementationLS*)impl)->createLSSerializer(); + + XMLFormatTarget *myFormTarget; + myFormTarget = new MemBufFormatTarget (); + DOMLSOutput* theOutput = ((DOMImplementationLS*)impl)->createLSOutput(); + theOutput->setByteStream(myFormTarget); + + // do the serialization through DOMLSSerializer::write(); + theSerializer->write(node, theOutput); + + output = (char *)((MemBufFormatTarget*)myFormTarget)->getRawBuffer(); + + // clean up + theOutput->release(); + theSerializer->release(); + delete myFormTarget; + + return output; +} +#else CStdString DomSerializer::DomNodeToString(DOMNode* node) { CStdString output; @@ -212,3 +241,4 @@ CStdString DomSerializer::DomNodeToString(DOMNode* node) return output; } +#endif