Skip to content

Commit c144694

Browse files
committed
H265RtpDepacketizer: Handle empty RTP packet payloads
Similar to the fix for the H.264 RTP depacketizer in https://github.com/ paullouisageneau/pull/1140.
1 parent 73bf9ac commit c144694

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/h265rtpdepacketizer.cpp

+11
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,17 @@ message_vector H265RtpDepacketizer::buildFrames(message_vector::iterator begin,
3131
auto pkt = it->get();
3232
auto pktParsed = reinterpret_cast<const rtc::RtpHeader *>(pkt->data());
3333
auto rtpHeaderSize = pktParsed->getSize() + pktParsed->getExtensionHeaderSize();
34+
auto rtpPaddingSize = 0;
35+
36+
if (pktParsed->padding()) {
37+
rtpPaddingSize = std::to_integer<uint8_t>(pkt->at(pkt->size() - 1));
38+
}
39+
40+
if (pkt->size() == rtpHeaderSize + rtpPaddingSize) {
41+
PLOG_VERBOSE << "H.265 RTP packet has empty payload";
42+
continue;
43+
}
44+
3445
auto nalUnitHeader =
3546
H265NalUnitHeader{std::to_integer<uint8_t>(pkt->at(rtpHeaderSize)),
3647
std::to_integer<uint8_t>(pkt->at(rtpHeaderSize + 1))};

0 commit comments

Comments
 (0)