播放flv流时,非AAC与H264编码时,打印警告日志

This commit is contained in:
xiongziliang 2021-01-09 19:03:02 +08:00
parent 97528c2583
commit a9be01fbec

View File

@ -334,6 +334,21 @@ bool HttpSession::checkLiveStreamFlv(const function<void()> &cb){
} }
//直播牺牲延时提升发送性能 //直播牺牲延时提升发送性能
setSocketFlags(); setSocketFlags();
//非H264/AAC时打印警告日志防止用户提无效问题
auto tracks = src->getTracks(false);
for (auto &track : tracks) {
switch (track->getCodecId()) {
case CodecH264:
case CodecAAC:
break;
default: {
WarnP(this) << "flv播放器一般只支持H264和AAC编码,该编码格式可能不被播放器支持:" << track->getCodecName();
break;
}
}
}
start(getPoller(), rtmp_src); start(getPoller(), rtmp_src);
}); });
} }