Skip to content

Commit c5c80b8

Browse files
committed
Add padding handling
1 parent f1da765 commit c5c80b8

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/h264rtpdepacketizer.cpp

+7-2
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,15 @@ message_vector H264RtpDepacketizer::buildFrames(message_vector::iterator begin,
4242
auto pktParsed = reinterpret_cast<const rtc::RtpHeader *>(pkt->data());
4343
auto headerSize =
4444
sizeof(rtc::RtpHeader) + pktParsed->csrcCount() + pktParsed->getExtensionHeaderSize();
45+
auto paddingSize = 0;
4546

46-
if (pkt->size() == headerSize) {
47+
if (pktParsed->padding()) {
48+
paddingSize = std::to_integer<uint8_t>(pkt->at(pkt->size() - 1));
49+
}
50+
51+
if (pkt->size() == headerSize + paddingSize) {
4752
PLOG_VERBOSE << "H.264 RTP packet has empty payload";
48-
continue;
53+
continue;
4954
}
5055

5156
auto nalUnitHeader = NalUnitHeader{std::to_integer<uint8_t>(pkt->at(headerSize))};

0 commit comments

Comments
 (0)