修复AAC rtp解码相关的bug

This commit is contained in:
xiongziliang
2019-01-24 12:21:29 +08:00
parent 22962a407e
commit a646640580
6 changed files with 40 additions and 20 deletions

View File

@@ -181,16 +181,16 @@ RtpCodec::Ptr Factory::getRtpEncoderById(CodecId codecId,
}
}
RtpCodec::Ptr Factory::getRtpDecoderById(CodecId codecId) {
switch (codecId){
RtpCodec::Ptr Factory::getRtpDecoderByTrack(const Track::Ptr &track) {
switch (track->getCodecId()){
case CodecH264:
return std::make_shared<H264RtpDecoder>();
case CodecH265:
return std::make_shared<H265RtpDecoder>();
case CodecAAC:
return std::make_shared<AACRtpDecoder>();
return std::make_shared<AACRtpDecoder>(track->clone());
default:
WarnL << "暂不支持该CodecId:" << codecId;
WarnL << "暂不支持该CodecId:" << track->getCodecId();
return nullptr;
}
}