Commit 0f3a8f4a by xgj

fix webrtc to rtmp multi slice on frame error

parent d74779dc
...@@ -183,7 +183,7 @@ void H264RtmpEncoder::inputFrame(const Frame::Ptr &frame) { ...@@ -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); RtmpCodec::inputRtmp(_lastPacket);
_lastPacket = nullptr; _lastPacket = nullptr;
} }
...@@ -214,10 +214,12 @@ void H264RtmpEncoder::inputFrame(const Frame::Ptr &frame) { ...@@ -214,10 +214,12 @@ void H264RtmpEncoder::inputFrame(const Frame::Ptr &frame) {
_lastPacket->buffer.append((char *) &size, 4); _lastPacket->buffer.append((char *) &size, 4);
_lastPacket->buffer.append(pcData, iLen); _lastPacket->buffer.append(pcData, iLen);
_lastPacket->body_size = _lastPacket->buffer.size(); _lastPacket->body_size = _lastPacket->buffer.size();
/*
if (type == H264Frame::NAL_B_P) { if (type == H264Frame::NAL_B_P) {
RtmpCodec::inputRtmp(_lastPacket); RtmpCodec::inputRtmp(_lastPacket);
_lastPacket = nullptr; _lastPacket = nullptr;
} }
*/
} }
void H264RtmpEncoder::makeVideoConfigPkt() { void H264RtmpEncoder::makeVideoConfigPkt() {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论