diff --git a/src/Rtmp/RtmpPlayerImp.h b/src/Rtmp/RtmpPlayerImp.h index 720bd63c..df90e0cd 100644 --- a/src/Rtmp/RtmpPlayerImp.h +++ b/src/Rtmp/RtmpPlayerImp.h @@ -51,7 +51,9 @@ private: } } void onMediaData(RtmpPacket &chunkData) override { - m_parser->inputRtmp(chunkData); + if(m_parser){ + m_parser->inputRtmp(chunkData); + } } }; diff --git a/src/Rtsp/RtpParser.cpp b/src/Rtsp/RtpParser.cpp index 6e668562..67940bc0 100644 --- a/src/Rtsp/RtpParser.cpp +++ b/src/Rtsp/RtpParser.cpp @@ -182,6 +182,9 @@ inline void RtpParser::onGetAudioTrack(const RtspTrack& audio) { m_strAudioCfg.push_back(cfg2); makeAdtsHeader(m_strAudioCfg,m_adts); getAACInfo(m_adts, m_iSampleRate, m_iChannel); + if(m_adts.profile >= 3){ + throw std::runtime_error("不支持该profile的AAC"); + } } inline void RtpParser::onGetVideoTrack(const RtspTrack& video) { diff --git a/src/Rtsp/Rtsp.cpp b/src/Rtsp/Rtsp.cpp index 49da3b79..c4d67a35 100644 --- a/src/Rtsp/Rtsp.cpp +++ b/src/Rtsp/Rtsp.cpp @@ -31,9 +31,15 @@ string FindField(const char* buf, const char* start, const char *end ,int bufSiz return string(msg_start, msg_end); } int parserSDP(const string& sdp, RtspTrack Track[2]) { - string track_str = "track"; + string track_str; if (sdp.find("trackID=") != string::npos) { track_str = "trackID="; + }else if (sdp.find("track") != string::npos) { + track_str = "track"; + }else if (sdp.find("streamid=") != string::npos) { + track_str = "streamid="; + }else if (sdp.find("stream") != string::npos) { + track_str = "stream"; } int track_cnt = 0; string::size_type pos_head = sdp.find("m=");