Skip to content

Commit

Permalink
Fixed data conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
sbarrac committed Apr 1, 2024
1 parent 41320cc commit 2f13f9e
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/rtppacketizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,15 @@ message_ptr RtpPacketizer::packetize(shared_ptr<binary> payload, bool mark) {
}

if (setPlayoutDelay) {
uint16_t min = rtpConfig->playoutDelayMin & 0xFFF;
uint16_t max = rtpConfig->playoutDelayMax & 0xFFF;

// 12 bits for min + 12 bits for max
char data[] = {rtpConfig->playoutDelayMin >> 4,
(char)(rtpConfig->playoutDelayMin << 4) |
(char)(rtpConfig->playoutDelayMax >> 8),
rtpConfig->playoutDelayMax};
char data[] = {
(min >> 4) & 0xFF,
((min & 0xF) << 4) | ((max >> 8) & 0xF),
max & 0xFF
};

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

0 comments on commit 2f13f9e

Please sign in to comment.