diff --git a/src/Extension/H264Rtmp.cpp b/src/Extension/H264Rtmp.cpp index ca58472a..b196cb6e 100644 --- a/src/Extension/H264Rtmp.cpp +++ b/src/Extension/H264Rtmp.cpp @@ -183,7 +183,7 @@ void H264RtmpEncoder::inputFrame(const Frame::Ptr &frame) { } } - if(_lastPacket && (_lastPacket->time_stamp != frame->dts() || type == H264Frame::NAL_B_P)) { + if(_lastPacket && (_lastPacket->time_stamp != frame->dts() || pcData[1]&0x80 != 0)) { RtmpCodec::inputRtmp(_lastPacket); _lastPacket = nullptr; } @@ -214,10 +214,12 @@ void H264RtmpEncoder::inputFrame(const Frame::Ptr &frame) { _lastPacket->buffer.append((char *) &size, 4); _lastPacket->buffer.append(pcData, iLen); _lastPacket->body_size = _lastPacket->buffer.size(); + /* if (type == H264Frame::NAL_B_P) { RtmpCodec::inputRtmp(_lastPacket); _lastPacket = nullptr; } + */ } void H264RtmpEncoder::makeVideoConfigPkt() {