rtmp packet must has vlc when flush

This commit is contained in:
xiongguangjie
2021-06-19 01:54:57 +08:00
parent a28aeb2148
commit d215502ff5
3 changed files with 16 additions and 3 deletions

View File

@@ -182,8 +182,8 @@ void H264RtmpEncoder::inputFrame(const Frame::Ptr &frame) {
break;
}
}
if((frame->configFrame() || frame->keyFrame()) && _lastPacket){
// key frame or sps pps flush frame
if(frame->configFrame() && _lastPacket &&_lastPacketHasVCL){
//sps pps flush frame
RtmpCodec::inputRtmp(_lastPacket);
_lastPacket = nullptr;
_lastPacketHasVCL = false;