@@ -162,7 +162,7 @@ void CRateEstimator::updateInputRate(const time_point& time, int pkts, int bytes
162162 }
163163}
164164
165- CSndBuffer::CSndBuffer (int size, int maxpld)
165+ CSndBuffer::CSndBuffer (int size, int maxpld, int authtag )
166166 : m_BufLock()
167167 , m_pBlock(NULL )
168168 , m_pFirstBlock(NULL )
@@ -172,6 +172,7 @@ CSndBuffer::CSndBuffer(int size, int maxpld)
172172 , m_iNextMsgNo(1 )
173173 , m_iSize(size)
174174 , m_iBlockLen(maxpld)
175+ , m_iAuthTagSize(authtag)
175176 , m_iCount(0 )
176177 , m_iBytesCount(0 )
177178{
@@ -233,7 +234,7 @@ void CSndBuffer::addBuffer(const char* data, int len, SRT_MSGCTRL& w_mctrl)
233234 int32_t & w_seqno = w_mctrl.pktseq ;
234235 int64_t & w_srctime = w_mctrl.srctime ;
235236 const int & ttl = w_mctrl.msgttl ;
236- const int iPktLen = m_iBlockLen; // Payload length per packet.
237+ const int iPktLen = m_iBlockLen - m_iAuthTagSize ; // Payload length per packet.
237238 int iNumBlocks = len / iPktLen;
238239 if ((len % m_iBlockLen) != 0 )
239240 ++iNumBlocks;
@@ -336,7 +337,7 @@ void CSndBuffer::addBuffer(const char* data, int len, SRT_MSGCTRL& w_mctrl)
336337
337338int CSndBuffer::addBufferFromFile (fstream& ifs, int len)
338339{
339- const int iPktLen = m_iBlockLen; // Payload length per packet.
340+ const int iPktLen = m_iBlockLen - m_iAuthTagSize ; // Payload length per packet.
340341 int iNumBlocks = len / iPktLen;
341342 if ((len % m_iBlockLen) != 0 )
342343 ++iNumBlocks;
@@ -416,7 +417,7 @@ int CSndBuffer::readData(CPacket& w_packet, steady_clock::time_point& w_srctime,
416417 // Make the packet REFLECT the data stored in the buffer.
417418 w_packet.m_pcData = m_pCurrBlock->m_pcData ;
418419 readlen = m_pCurrBlock->m_iLength ;
419- w_packet.setLength (readlen);
420+ w_packet.setLength (readlen, m_iBlockLen );
420421 w_packet.m_iSeqNo = m_pCurrBlock->m_iSeqNo ;
421422
422423 // 1. On submission (addBuffer), the KK flag is set to EK_NOENC (0).
@@ -589,7 +590,7 @@ int CSndBuffer::readData(const int offset, CPacket& w_packet, steady_clock::time
589590
590591 w_packet.m_pcData = p->m_pcData ;
591592 const int readlen = p->m_iLength ;
592- w_packet.setLength (readlen);
593+ w_packet.setLength (readlen, m_iBlockLen );
593594
594595 // XXX Here the value predicted to be applied to PH_MSGNO field is extracted.
595596 // As this function is predicted to extract the data to send as a rexmited packet,
0 commit comments