修复缓存不够导致获取vps/sps/pps失败的问题
This commit is contained in:
parent
1e397ce963
commit
30bbbd2e2f
|
|
@ -53,14 +53,14 @@ static bool getH265ConfigFrame(const RtmpPacket &thiz,string &frame) {
|
||||||
|
|
||||||
struct mpeg4_hevc_t hevc = {0};
|
struct mpeg4_hevc_t hevc = {0};
|
||||||
if (mpeg4_hevc_decoder_configuration_record_load((uint8_t *) extra, bytes, &hevc) > 0) {
|
if (mpeg4_hevc_decoder_configuration_record_load((uint8_t *) extra, bytes, &hevc) > 0) {
|
||||||
uint8_t config[1024] = {0};
|
uint8_t *config = new uint8_t[bytes * 2];
|
||||||
int size = mpeg4_hevc_to_nalu(&hevc, config, sizeof(config));
|
int size = mpeg4_hevc_to_nalu(&hevc, config, bytes * 2);
|
||||||
if (size > 4) {
|
if (size > 4) {
|
||||||
frame.assign((char *) config + 4, size - 4);
|
frame.assign((char *) config + 4, size - 4);
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
delete [] config;
|
||||||
|
return size > 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue