mirror of https://bitbucket.org/ausocean/av.git
protocol/rtcp: fixed writing of SenderSSRC in ReceiverReport header, now test passing.
This commit is contained in:
parent
956110f0ef
commit
22d71f8a57
|
@ -129,7 +129,7 @@ func (h Header) writeHeader(buf []byte, l int) {
|
||||||
buf[0] = h.Version<<6 | asByte(h.Padding)<<5 | 0x1f&h.ReportCount
|
buf[0] = h.Version<<6 | asByte(h.Padding)<<5 | 0x1f&h.ReportCount
|
||||||
buf[1] = h.Type
|
buf[1] = h.Type
|
||||||
binary.BigEndian.PutUint16(buf[2:], uint16(l))
|
binary.BigEndian.PutUint16(buf[2:], uint16(l))
|
||||||
buf[4] = byte(h.SenderSSRC)
|
binary.BigEndian.PutUint32(buf[4:], h.SenderSSRC)
|
||||||
}
|
}
|
||||||
|
|
||||||
func asByte(b bool) byte {
|
func asByte(b bool) byte {
|
||||||
|
|
|
@ -41,6 +41,8 @@ func TestReceiverReportBytes(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
got := report.Bytes()
|
got := report.Bytes()
|
||||||
|
t.Logf("Got: %v\n", got)
|
||||||
|
t.Logf("Want: %v\n", expect)
|
||||||
if !bytes.Equal(got, expect) {
|
if !bytes.Equal(got, expect) {
|
||||||
t.Errorf("did not get expected result. \nGot: %v\nWant: %v\n", got, expect)
|
t.Errorf("did not get expected result. \nGot: %v\nWant: %v\n", got, expect)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue