mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-22 19:00:01 +08:00
修复过滤多余帧类型导致的bug
This commit is contained in:
parent
bd8a9a78e8
commit
6e59000265
@ -49,7 +49,6 @@ public:
|
||||
NAL_SPS = 7,
|
||||
NAL_PPS = 8,
|
||||
NAL_IDR = 5,
|
||||
NAL_B_P = 1
|
||||
} NalType;
|
||||
|
||||
char *data() const override{
|
||||
@ -315,18 +314,15 @@ private:
|
||||
//I
|
||||
insertConfigFrame(frame);
|
||||
VideoTrack::inputFrame(frame);
|
||||
_last_frame_is_idr = true;
|
||||
}
|
||||
break;
|
||||
|
||||
case H264Frame::NAL_B_P:{
|
||||
//B or P
|
||||
default:
|
||||
VideoTrack::inputFrame(frame);
|
||||
_last_frame_is_idr = false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
_last_frame_is_idr = type == H264Frame::NAL_IDR;
|
||||
if(_width == 0 && ready()){
|
||||
onReady();
|
||||
}
|
||||
|
@ -144,9 +144,6 @@ void H264RtmpEncoder::inputFrame(const Frame::Ptr &frame) {
|
||||
}
|
||||
}
|
||||
|
||||
switch (type){
|
||||
case H264Frame::NAL_IDR:
|
||||
case H264Frame::NAL_B_P:{
|
||||
if(_lastPacket && _lastPacket->timeStamp != frame->stamp()) {
|
||||
RtmpCodec::inputRtmp(_lastPacket, _lastPacket->isVideoKeyFrame());
|
||||
_lastPacket = nullptr;
|
||||
@ -177,12 +174,6 @@ void H264RtmpEncoder::inputFrame(const Frame::Ptr &frame) {
|
||||
_lastPacket->strBuf.append(pcData, iLen);
|
||||
_lastPacket->bodySize = _lastPacket->strBuf.size();
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void H264RtmpEncoder::makeVideoConfigPkt() {
|
||||
|
Loading…
Reference in New Issue
Block a user