mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-26 04:31:37 +08:00
p帧时间戳异常时确保rtmp播放正常:#724
This commit is contained in:
parent
34bbfc8bcb
commit
52480717e3
@ -185,7 +185,7 @@ void H264RtmpEncoder::inputFrame(const Frame::Ptr &frame) {
|
||||
}
|
||||
}
|
||||
|
||||
if(_lastPacket && _lastPacket->time_stamp != frame->dts()) {
|
||||
if(_lastPacket && (_lastPacket->time_stamp != frame->dts() || type == H264Frame::NAL_B_P)) {
|
||||
RtmpCodec::inputRtmp(_lastPacket);
|
||||
_lastPacket = nullptr;
|
||||
}
|
||||
@ -216,6 +216,10 @@ 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() {
|
||||
|
Loading…
Reference in New Issue
Block a user