From 30bbbd2e2f985b51ffbf1cb471bf34dc2c4ddde2 Mon Sep 17 00:00:00 2001 From: xiongziliang <771730766@qq.com> Date: Sat, 8 Aug 2020 12:12:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=BC=93=E5=AD=98=E4=B8=8D?= =?UTF-8?q?=E5=A4=9F=E5=AF=BC=E8=87=B4=E8=8E=B7=E5=8F=96vps/sps/pps?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Extension/H265Rtmp.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Extension/H265Rtmp.cpp b/src/Extension/H265Rtmp.cpp index ff346582..150ac1a8 100644 --- a/src/Extension/H265Rtmp.cpp +++ b/src/Extension/H265Rtmp.cpp @@ -53,14 +53,14 @@ static bool getH265ConfigFrame(const RtmpPacket &thiz,string &frame) { struct mpeg4_hevc_t hevc = {0}; if (mpeg4_hevc_decoder_configuration_record_load((uint8_t *) extra, bytes, &hevc) > 0) { - uint8_t config[1024] = {0}; - int size = mpeg4_hevc_to_nalu(&hevc, config, sizeof(config)); + uint8_t *config = new uint8_t[bytes * 2]; + int size = mpeg4_hevc_to_nalu(&hevc, config, bytes * 2); if (size > 4) { frame.assign((char *) config + 4, size - 4); - return true; } + delete [] config; + return size > 4; } - return false; } #endif