Skip to content
Snippets Groups Projects
Commit 7a1593f8 authored by Lyubomir Marinov's avatar Lyubomir Marinov
Browse files

Fixes 'Invalid RTCP Version' exception caused by incorrect RTCP feedback packet construction.

parent 3cb03ee2
No related branches found
No related tags found
No related merge requests found
......@@ -59,26 +59,26 @@ public RTCPFeedbackPacket(int type, int payloadType, long sender, long src)
public void writeTo(OutputDataStream out)
{
byte data[] = new byte[12];
byte vpfmt = (byte)((2 << 7) | (0 << 6) | (byte)fmt);
byte vpfmt = (byte) (0x80 /* RTP version */ | (fmt & 0x1F));
data[0] = vpfmt;
data[1] = (byte)payloadType;
data[1] = (byte) payloadType;
/* length (in 32-bit words minus one) */
data[2] = 0;
data[3] = 2; /* common packet is 12 bytes so (12/4) - 1 */
/* sender SSRC */
data[4] = (byte)(senderSSRC >> 24);
data[5] = (byte)((senderSSRC >> 16) & 0xFF);
data[6] = (byte)((senderSSRC >> 8) & 0xFF);
data[7] = (byte)(senderSSRC & 0xFF);
data[4] = (byte) (senderSSRC >> 24);
data[5] = (byte) ((senderSSRC >> 16) & 0xFF);
data[6] = (byte) ((senderSSRC >> 8) & 0xFF);
data[7] = (byte) (senderSSRC & 0xFF);
/* source SSRC */
data[8] = (byte)(sourceSSRC >> 24);
data[9] = (byte)((sourceSSRC >> 16) & 0xFF);
data[10] = (byte)((sourceSSRC >> 8) & 0xFF);
data[11] = (byte)(sourceSSRC & 0xFF);
data[8] = (byte) (sourceSSRC >> 24);
data[9] = (byte) ((sourceSSRC >> 16) & 0xFF);
data[10] = (byte) ((sourceSSRC >> 8) & 0xFF);
data[11] = (byte) (sourceSSRC & 0xFF);
/* effective write */
out.write(data, 0, 12);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment