修复fu-a打包时,无rtp负载的情况

This commit is contained in:
xia-chu 2021-04-28 16:03:05 +08:00
parent 726e909601
commit 514a028eac

View File

@ -204,9 +204,9 @@ 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){ void H264RtpEncoder::packRtpFu(const char *ptr, size_t len, uint32_t pts, bool is_mark, bool gop_pos){
auto packet_size = getMaxSize() - 2; auto packet_size = getMaxSize() - 1;
if (len <= packet_size) { if (len <= packet_size) {
//小于FU-A打包最小字节长度要求采用STAP-A模式如果frame长度正好是mtu-2, 那么打包的rtp长度是mtu + 1 //小于FU-A打包最小字节长度要求采用STAP-A模式
packRtpStapA(ptr, len, pts, is_mark, gop_pos); packRtpStapA(ptr, len, pts, is_mark, gop_pos);
return; return;
} }