兼容一些奇怪的流

This commit is contained in:
xiongziliang 2020-09-06 17:56:26 +08:00
parent 09e484794b
commit faa8786f8f

View File

@ -179,7 +179,7 @@ public:
*/
void inputFrame(const Frame::Ptr &frame) override{
int type = H264_TYPE(*((uint8_t *)frame->data() + frame->prefixSize()));
if(type == H264Frame::NAL_SPS || type == H264Frame::NAL_SEI){
if(type == H264Frame::NAL_SPS || type == H264Frame::NAL_PPS || type == H264Frame::NAL_SEI){
//有些设备会把SPS PPS IDR帧当做一个帧打包所以我们要split一下
splitH264(frame->data(), frame->size(), frame->prefixSize(), [&](const char *ptr, int len, int prefix) {
H264FrameInternal::Ptr sub_frame = std::make_shared<H264FrameInternal>(frame, (char *)ptr, len, prefix);