- more cleanups - use uuid library on the rtphone level + formatting fixed
This commit is contained in:
@@ -331,6 +331,7 @@ AudioReceiver::AudioReceiver(const CodecList::Settings& settings, MT::Statistics
|
||||
mResampler48.start(AUDIO_CHANNELS, 48000, AUDIO_SAMPLERATE);
|
||||
|
||||
// Init codecs
|
||||
mCodecList.setSettings(settings);
|
||||
mCodecList.fillCodecMap(mCodecMap);
|
||||
|
||||
#if defined(DUMP_DECODED)
|
||||
@@ -442,14 +443,14 @@ bool AudioReceiver::add(const std::shared_ptr<jrtplib::RTPPacket>& 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();
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include <math.h>
|
||||
#include <iostream>
|
||||
|
||||
#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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user