Enhance compatibility with non-compliant RTMP AAC streams

This commit is contained in:
xia-chu 2024-03-22 20:37:27 +08:00 committed by 夏楚
parent 49ddde28c0
commit f5ca61d235

View File

@ -17,7 +17,7 @@ using namespace toolkit;
namespace mediakit { namespace mediakit {
void AACRtmpDecoder::inputRtmp(const RtmpPacket::Ptr &pkt) { void AACRtmpDecoder::inputRtmp(const RtmpPacket::Ptr &pkt) {
CHECK(pkt->size() > 2); CHECK_RET(pkt->size() > 2);
if (pkt->isConfigFrame()) { if (pkt->isConfigFrame()) {
getTrack()->setExtraData((uint8_t *)pkt->data() + 2, pkt->size() - 2); getTrack()->setExtraData((uint8_t *)pkt->data() + 2, pkt->size() - 2);
return; return;