diff --git a/src/engine/helper/CMakeLists.txt b/src/engine/helper/CMakeLists.txt index b651f2a9..ba84ca13 100644 --- a/src/engine/helper/CMakeLists.txt +++ b/src/engine/helper/CMakeLists.txt @@ -15,3 +15,4 @@ set_property(TARGET helper_lib PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$& p, Codec** co if (payloadLength >= 1 && payloadLength <= 6 && (ptype == 0 || ptype == 8)) time_length = mLastPacketTimeLength ? mLastPacketTimeLength : 20; else - // Check if packet is too short from time length side - if (time_length < 2) - { - // It will cause statistics to report about bad RTP packet - // I have to replay last packet payload here to avoid report about lost packet - mBuffer.add(p, time_length, codecIter->second->samplerate()); - return false; - } + // Check if packet is too short from time length side + if (time_length < 2) + { + // It will cause statistics to report about bad RTP packet + // I have to replay last packet payload here to avoid report about lost packet + mBuffer.add(p, time_length, codecIter->second->samplerate()); + return false; + } // Queue packet to buffer auto packet = mBuffer.add(p, time_length, codecIter->second->samplerate()).get(); diff --git a/src/engine/media/MT_Statistics.cpp b/src/engine/media/MT_Statistics.cpp index b7161fba..0afb9aa5 100644 --- a/src/engine/media/MT_Statistics.cpp +++ b/src/engine/media/MT_Statistics.cpp @@ -1,4 +1,5 @@ #include +#include #include "MT_Statistics.h" #include "audio/Audio_Interface.h" @@ -55,8 +56,11 @@ void JitterStatistics::process(jrtplib::RTPPacket* packet, int rate) mReceiveTime = receiveTime; mReceiveTimestamp = timestamp; - // And mJitter are in seconds again - mJitter.process(mLastJitter.value() / float(rate)); + // And mJitter are in milliseconds again + float jitter_s = mLastJitter.value() / (float(rate)); + // std::cout << "Jitter (in seconds): " << std::dec << jitter_s << std::endl; + + mJitter.process(jitter_s); } }