兼容某些不规范的sdp

This commit is contained in:
xiongziliang 2019-08-06 16:23:20 +08:00
parent 008df0ab85
commit 2020e23437

View File

@ -36,10 +36,10 @@ namespace mediakit{
Track::Ptr Factory::getTrackBySdp(const SdpTrack::Ptr &track) { Track::Ptr Factory::getTrackBySdp(const SdpTrack::Ptr &track) {
if (strcasecmp(track->_codec.data(), "mpeg4-generic") == 0) { if (strcasecmp(track->_codec.data(), "mpeg4-generic") == 0) {
string aac_cfg_str = FindField(track->_fmtp.data(), "config=", nullptr); string aac_cfg_str = FindField(track->_fmtp.data(), "config=", nullptr);
if (aac_cfg_str.size() != 4) { if (aac_cfg_str.empty()) {
aac_cfg_str = FindField(track->_fmtp.data(), "config=", ";"); aac_cfg_str = FindField(track->_fmtp.data(), "config=", ";");
} }
if (aac_cfg_str.size() != 4) { if (aac_cfg_str.empty()) {
//延后获取adts头 //延后获取adts头
return std::make_shared<AACTrack>(); return std::make_shared<AACTrack>();
} }