mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-12-05 01:11:52 +08:00
防止rtmp打包不支持的编码类型时频繁打印警告日志
This commit is contained in:
parent
aa56576b0e
commit
8cf8e4ed5f
@ -178,8 +178,9 @@ RtmpCodec::Ptr Factory::getRtmpDecoderByTrack(const Track::Ptr &track) {
|
||||
RtmpCodec::Ptr Factory::getRtmpEncoderByTrack(const Track::Ptr &track) {
|
||||
auto it = s_plugins.find(track->getCodecId());
|
||||
if (it == s_plugins.end()) {
|
||||
WarnL << "Unsupported codec: " << track->getCodecName() << ", use CommonRtmpEncoder";
|
||||
return std::make_shared<CommonRtmpEncoder>(track);
|
||||
auto amf = Factory::getAmfByCodecId(track->getCodecId());
|
||||
WarnL << "Unsupported codec: " << track->getCodecName() << (amf ? ", use CommonRtmpEncoder" : "");
|
||||
return amf ? std::make_shared<CommonRtmpEncoder>(track) : nullptr;
|
||||
}
|
||||
return it->second->getRtmpEncoderByTrack(track);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user