修复mp4解复用器输出sps pps帧时设置起始头长度错误问题 (#2627)

mp4解复用器在解析mp4文件时,当获取到mp4头中sps/pps等配置帧信息时,创建相应的Frame未设置prefix size;导致后续输入H264Track分帧逻辑异常。
This commit is contained in:
xiongguangjie 2023-07-06 15:47:30 +08:00 committed by GitHub
parent 7c6b612a4d
commit 788915c7f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -102,7 +102,7 @@ void MP4Demuxer::onVideoTrack(uint32_t track, uint8_t object, int width, int hei
uint8_t config[1024 * 10] = {0};
int size = mpeg4_avc_to_nalu(&avc, config, sizeof(config));
if (size > 0) {
video->inputFrame(std::make_shared<H264FrameNoCacheAble>((char *)config, size, 0, 4));
video->inputFrame(std::make_shared<H264FrameNoCacheAble>((char *)config, size, 0, 0,4));
}
}
}
@ -117,7 +117,7 @@ void MP4Demuxer::onVideoTrack(uint32_t track, uint8_t object, int width, int hei
uint8_t config[1024 * 10] = {0};
int size = mpeg4_hevc_to_nalu(&hevc, config, sizeof(config));
if (size > 0) {
video->inputFrame(std::make_shared<H265FrameNoCacheAble>((char *) config, size, 0, 4));
video->inputFrame(std::make_shared<H265FrameNoCacheAble>((char *) config, size, 0, 0,4));
}
}
}