Skip to content
Snippets Groups Projects
Commit ccf0ee2c authored by Alexandre Savard's avatar Alexandre Savard
Browse files

no maximum in rtp decode (#1143)

parent 259d3fc9
Branches
Tags
No related merge requests found
...@@ -465,13 +465,13 @@ AudioRtpRTX::receiveSessionForSpkr (int& countTime) ...@@ -465,13 +465,13 @@ AudioRtpRTX::receiveSessionForSpkr (int& countTime)
// printf("AudioRtpRTX::receiveSessionForSpkr() Size of data from %i \n",size); // printf("AudioRtpRTX::receiveSessionForSpkr() Size of data from %i \n",size);
// Decode data with relevant codec // Decode data with relevant codec
unsigned int max = (unsigned int)(_codecSampleRate * _layerFrameSize / 1000); // unsigned int max = (unsigned int)(_codecSampleRate * _layerFrameSize / 1000);
if ( size > max ) { // if ( size > max ) {
_debug("We have received from RTP a packet larger than expected: %d VS %d\n", size, max); // _debug("We have received from RTP a packet larger than expected: %d VS %d\n", size, max);
_debug("The packet size has been cropped\n"); // _debug("The packet size has been cropped\n");
size=max; // size=max;
} // }
if (_audiocodec != NULL) { if (_audiocodec != NULL) {
...@@ -480,10 +480,10 @@ AudioRtpRTX::receiveSessionForSpkr (int& countTime) ...@@ -480,10 +480,10 @@ AudioRtpRTX::receiveSessionForSpkr (int& countTime)
//buffer _receiveDataDecoded ----> short int or int16, coded on 2 bytes //buffer _receiveDataDecoded ----> short int or int16, coded on 2 bytes
int nbInt16 = expandedSize / sizeof(int16); int nbInt16 = expandedSize / sizeof(int16);
//nbInt16 represents the number of samples we just decoded //nbInt16 represents the number of samples we just decoded
if ((unsigned int)nbInt16 > max) { // if ((unsigned int)nbInt16 > max) {
_debug("We have decoded an RTP packet larger than expected: %d VS %d. Cropping.\n", nbInt16, max); // _debug("We have decoded an RTP packet larger than expected: %d VS %d. Cropping.\n", nbInt16, max);
nbInt16=max; // nbInt16=max;
} // }
int nbSample = nbInt16; int nbSample = nbInt16;
if (_audiocodec->getClockRate() != _layerSampleRate) { if (_audiocodec->getClockRate() != _layerSampleRate) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment