mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-12-05 09:21:59 +08:00
Compare commits
2 Commits
aa56576b0e
...
8a27e11c4c
Author | SHA1 | Date | |
---|---|---|---|
|
8a27e11c4c | ||
|
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);
|
||||||
}
|
}
|
||||||
|
@ -91,9 +91,11 @@ void DecoderImp::onStream(int stream, int codecid, const void *extra, size_t byt
|
|||||||
// G711传统只支持 8000/1/16的规格,FFmpeg貌似做了扩展,但是这里不管它了 [AUTO-TRANSLATED:851813f7]
|
// G711传统只支持 8000/1/16的规格,FFmpeg貌似做了扩展,但是这里不管它了 [AUTO-TRANSLATED:851813f7]
|
||||||
// G711 traditionally only supports the 8000/1/16 specification. FFmpeg seems to have extended it, but we'll ignore that here.
|
// G711 traditionally only supports the 8000/1/16 specification. FFmpeg seems to have extended it, but we'll ignore that here.
|
||||||
auto codec = getCodecByMpegId(codecid);
|
auto codec = getCodecByMpegId(codecid);
|
||||||
auto track= Factory::getTrackByCodecId(codec);
|
if (codec != CodecInvalid) {
|
||||||
if (track) {
|
auto track = Factory::getTrackByCodecId(codec);
|
||||||
onTrack(stream, std::move(track));
|
if (track) {
|
||||||
|
onTrack(stream, std::move(track));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// 防止未获取视频track提前complete导致忽略后续视频的问题,用于兼容一些不太规范的ps流 [AUTO-TRANSLATED:d6b349b5]
|
// 防止未获取视频track提前complete导致忽略后续视频的问题,用于兼容一些不太规范的ps流 [AUTO-TRANSLATED:d6b349b5]
|
||||||
// Prevent the problem of ignoring subsequent video due to premature completion of the video track before it is obtained. This is used to be compatible with some non-standard PS streams.
|
// Prevent the problem of ignoring subsequent video due to premature completion of the video track before it is obtained. This is used to be compatible with some non-standard PS streams.
|
||||||
|
Loading…
Reference in New Issue
Block a user