From 629c39685b05c9267f7fa58f3950acfaba8616ac Mon Sep 17 00:00:00 2001 From: xiongziliang <771730766@qq.com> Date: Sun, 31 Jan 2021 18:48:28 +0800 Subject: [PATCH] rtp打包添加mark位:#713 --- src/Extension/CommonRtp.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Extension/CommonRtp.cpp b/src/Extension/CommonRtp.cpp index 6ce91bb..4e50c71 100644 --- a/src/Extension/CommonRtp.cpp +++ b/src/Extension/CommonRtp.cpp @@ -77,9 +77,16 @@ void CommonRtpEncoder::inputFrame(const Frame::Ptr &frame){ auto remain_size = len; const auto max_rtp_size = _ui32MtuSize - 20; + bool mark = false; while (remain_size > 0) { - auto rtp_size = remain_size > max_rtp_size ? max_rtp_size : remain_size; - RtpCodec::inputRtp(makeRtp(getTrackType(), ptr, rtp_size, false, stamp), false); + size_t rtp_size; + if (remain_size > max_rtp_size) { + rtp_size = max_rtp_size; + } else { + rtp_size = remain_size; + mark = true; + } + RtpCodec::inputRtp(makeRtp(getTrackType(), ptr, rtp_size, mark, stamp), false); ptr += rtp_size; remain_size -= rtp_size; } -- libgit2 0.26.0