mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-12-05 09:21:59 +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) {
|
RtmpCodec::Ptr Factory::getRtmpEncoderByTrack(const Track::Ptr &track) {
|
||||||
auto it = s_plugins.find(track->getCodecId());
|
auto it = s_plugins.find(track->getCodecId());
|
||||||
if (it == s_plugins.end()) {
|
if (it == s_plugins.end()) {
|
||||||
WarnL << "Unsupported codec: " << track->getCodecName() << ", use CommonRtmpEncoder";
|
auto amf = Factory::getAmfByCodecId(track->getCodecId());
|
||||||
return std::make_shared<CommonRtmpEncoder>(track);
|
WarnL << "Unsupported codec: " << track->getCodecName() << (amf ? ", use CommonRtmpEncoder" : "");
|
||||||
|
return amf ? std::make_shared<CommonRtmpEncoder>(track) : nullptr;
|
||||||
}
|
}
|
||||||
return it->second->getRtmpEncoderByTrack(track);
|
return it->second->getRtmpEncoderByTrack(track);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user