修复"Too short data for FU-A H.264 RTP packet"的问题

This commit is contained in:
xia-chu 2021-04-28 16:07:01 +08:00
parent 514a028eac
commit e021279fab

View File

@ -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;