mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-26 12:37:09 +08:00
修复mp4解复用器输出sps pps帧时设置起始头长度错误问题 (#2627)
mp4解复用器在解析mp4文件时,当获取到mp4头中sps/pps等配置帧信息时,创建相应的Frame未设置prefix size;导致后续输入H264Track分帧逻辑异常。
This commit is contained in:
parent
7c6b612a4d
commit
788915c7f7
@ -102,7 +102,7 @@ void MP4Demuxer::onVideoTrack(uint32_t track, uint8_t object, int width, int hei
|
|||||||
uint8_t config[1024 * 10] = {0};
|
uint8_t config[1024 * 10] = {0};
|
||||||
int size = mpeg4_avc_to_nalu(&avc, config, sizeof(config));
|
int size = mpeg4_avc_to_nalu(&avc, config, sizeof(config));
|
||||||
if (size > 0) {
|
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};
|
uint8_t config[1024 * 10] = {0};
|
||||||
int size = mpeg4_hevc_to_nalu(&hevc, config, sizeof(config));
|
int size = mpeg4_hevc_to_nalu(&hevc, config, sizeof(config));
|
||||||
if (size > 0) {
|
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));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user