Skip to content

Commit 2f13f9e

Browse files
committed
Fixed data conversion
1 parent 41320cc commit 2f13f9e

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/rtppacketizer.cpp

+8-4
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,15 @@ message_ptr RtpPacketizer::packetize(shared_ptr<binary> payload, bool mark) {
9292
}
9393

9494
if (setPlayoutDelay) {
95+
uint16_t min = rtpConfig->playoutDelayMin & 0xFFF;
96+
uint16_t max = rtpConfig->playoutDelayMax & 0xFFF;
97+
9598
// 12 bits for min + 12 bits for max
96-
char data[] = {rtpConfig->playoutDelayMin >> 4,
97-
(char)(rtpConfig->playoutDelayMin << 4) |
98-
(char)(rtpConfig->playoutDelayMax >> 8),
99-
rtpConfig->playoutDelayMax};
99+
char data[] = {
100+
(min >> 4) & 0xFF,
101+
((min & 0xF) << 4) | ((max >> 8) & 0xF),
102+
max & 0xFF
103+
};
100104

101105
extHeader->writeOneByteHeader(offset, rtpConfig->playoutDelayId, (byte *)data, 3);
102106
offset += 4;

0 commit comments

Comments
 (0)