Rtmp: 获取h264sps/aac config失败时打印rtmp包内容

This commit is contained in:
xiongziliang
2022-01-08 16:21:00 +08:00
parent 692febcadd
commit f4d8eb4515
3 changed files with 26 additions and 59 deletions

View File

@@ -22,7 +22,7 @@ static string getAacCfg(const RtmpPacket &thiz) {
return ret;
}
if (thiz.buffer.size() < 4) {
WarnL << "bad aac cfg!";
WarnL << "get aac config failed, rtmp packet is: " << hexdump(thiz.data(), thiz.size());
return ret;
}
ret = thiz.buffer.substr(2);
@@ -32,7 +32,9 @@ static string getAacCfg(const RtmpPacket &thiz) {
void AACRtmpDecoder::inputRtmp(const RtmpPacket::Ptr &pkt) {
if (pkt->isCfgFrame()) {
_aac_cfg = getAacCfg(*pkt);
onGetAAC(nullptr, 0, 0);
if (!_aac_cfg.empty()) {
onGetAAC(nullptr, 0, 0);
}
return;
}