diff --git a/src/Extension/Factory.cpp b/src/Extension/Factory.cpp index d65dbb56..053dd5a1 100644 --- a/src/Extension/Factory.cpp +++ b/src/Extension/Factory.cpp @@ -63,13 +63,14 @@ Track::Ptr Factory::getTrackBySdp(const SdpTrack::Ptr &track) { //a=fmtp:96 packetization-mode=1;profile-level-id=42C01F;sprop-parameter-sets=Z0LAH9oBQBboQAAAAwBAAAAPI8YMqA==,aM48gA== auto map = Parser::parseArgs(FindField(track->_fmtp.data()," ", nullptr),";","="); auto sps_pps = map["sprop-parameter-sets"]; - if(sps_pps.empty()){ - return std::make_shared(); - } string base64_SPS = FindField(sps_pps.data(), NULL, ","); string base64_PPS = FindField(sps_pps.data(), ",", NULL); auto sps = decodeBase64(base64_SPS); auto pps = decodeBase64(base64_PPS); + if(sps.empty() || pps.empty()){ + return std::make_shared(); + } + return std::make_shared(sps,pps,0,0); }