OSDN Git Service

Fix receiver report handling.
authorAndreas Huber <andih@google.com>
Mon, 13 May 2013 20:29:46 +0000 (13:29 -0700)
committerAndreas Huber <andih@google.com>
Mon, 13 May 2013 20:31:40 +0000 (13:31 -0700)
Not adjusting the size of the buffer would in effect only add a single
report block (the last one added would survive) and a whole lot of
uninitialized data to the report.

Change-Id: I5b4353d6d8c3becb1bc102afd42385b7851b1c3a

media/libstagefright/wifi-display/rtp/RTPReceiver.cpp

index 8fa1dae..2d22e79 100644 (file)
@@ -489,6 +489,8 @@ void RTPReceiver::Source::addReportBlock(
     ptr[21] = 0x00;
     ptr[22] = 0x00;
     ptr[23] = 0x00;
+
+    buf->setRange(buf->offset(), buf->size() + 24);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -1012,7 +1014,6 @@ void RTPReceiver::scheduleSendRR() {
 }
 
 void RTPReceiver::onSendRR() {
-#if 0
     sp<ABuffer> buf = new ABuffer(kMaxUDPPacketSize);
     buf->setRange(0, 0);
 
@@ -1053,7 +1054,6 @@ void RTPReceiver::onSendRR() {
     addSDES(buf);
 
     mNetSession->sendRequest(mRTCPSessionID, buf->data(), buf->size());
-#endif
 
     scheduleSendRR();
 }