From e021279fab6dc025f2930336ed03fdca18b97431 Mon Sep 17 00:00:00 2001 From: xia-chu <771730766@qq.com> Date: Wed, 28 Apr 2021 16:07:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D"Too=20short=20data=20for=20F?= =?UTF-8?q?U-A=20H.264=20RTP=20packet"=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Extension/H264Rtp.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Extension/H264Rtp.cpp b/src/Extension/H264Rtp.cpp index f9f4f570..0db7585a 100644 --- a/src/Extension/H264Rtp.cpp +++ b/src/Extension/H264Rtp.cpp @@ -204,8 +204,8 @@ void H264RtpEncoder::packRtp(const char *ptr, size_t len, uint32_t pts, bool is_ } void H264RtpEncoder::packRtpFu(const char *ptr, size_t len, uint32_t pts, bool is_mark, bool gop_pos){ - auto packet_size = getMaxSize() - 1; - if (len <= packet_size) { + auto packet_size = getMaxSize() - 2; + if (len <= packet_size + 1) { //小于FU-A打包最小字节长度要求,采用STAP-A模式 packRtpStapA(ptr, len, pts, is_mark, gop_pos); return;