Commit 0fb514e1 authored by Tristan Matthews's avatar Tristan Matthews
Browse files

* #15528: audiortp: issue warning when receiving wrong RTP packets

parent 73ecc03a
...@@ -153,7 +153,8 @@ AudioRtpRecord::~AudioRtpRecord() ...@@ -153,7 +153,8 @@ AudioRtpRecord::~AudioRtpRecord()
AudioRtpRecordHandler::AudioRtpRecordHandler(SIPCall &call) : AudioRtpRecordHandler::AudioRtpRecordHandler(SIPCall &call) :
audioRtpRecord_(), audioRtpRecord_(),
id_(call.getCallId()), id_(call.getCallId()),
gainController(8000, -10.0) gainController(8000, -10.0),
warningInterval_(0)
{} {}
...@@ -276,8 +277,16 @@ int AudioRtpRecordHandler::processDataEncode() ...@@ -276,8 +277,16 @@ int AudioRtpRecordHandler::processDataEncode()
void AudioRtpRecordHandler::processDataDecode(unsigned char *spkrData, size_t size, int payloadType) void AudioRtpRecordHandler::processDataDecode(unsigned char *spkrData, size_t size, int payloadType)
{ {
if (audioRtpRecord_.isDead() or getCodecPayloadType() != payloadType) if (audioRtpRecord_.isDead())
return;
if (audioRtpRecord_.codecPayloadType_ != payloadType) {
if (!warningInterval_) {
warningInterval_ = 250;
WARN("Invalid payload type %d, expected %d", payloadType, audioRtpRecord_.codecPayloadType_);
}
warningInterval_--;
return; return;
}
int inSamples = 0; int inSamples = 0;
size = std::min(size, audioRtpRecord_.decData_.size()); size = std::min(size, audioRtpRecord_.decData_.size());
......
...@@ -184,6 +184,7 @@ class AudioRtpRecordHandler { ...@@ -184,6 +184,7 @@ class AudioRtpRecordHandler {
private: private:
const std::string id_; const std::string id_;
GainControl gainController; GainControl gainController;
int warningInterval_;
}; };
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment