解决某些设备推流无法播放的问题

This commit is contained in:
xiongziliang 2018-10-09 16:39:35 +08:00
parent 5d7ed15355
commit dddc167fb0

View File

@ -94,16 +94,14 @@ public:
}
}
virtual void onGetMedia(const RtmpPacket::Ptr &pkt) {
if(!m_bRegisted){
lock_guard<recursive_mutex> lock(m_mtxMap);
if (m_mapCfgFrame.size() != m_iCfgFrameSize && pkt->isCfgFrame()) {
m_mapCfgFrame.emplace(pkt->typeId, pkt);
lock_guard<recursive_mutex> lock(m_mtxMap);
if (pkt->isCfgFrame()) {
m_mapCfgFrame.emplace(pkt->typeId, pkt);
if( m_mapCfgFrame.size() == m_iCfgFrameSize && m_bAsyncRegist){
m_bAsyncRegist = false;
MediaSource::regist();
m_bRegisted = true;
}
if(m_bAsyncRegist && !m_bRegisted && m_mapCfgFrame.size() == m_iCfgFrameSize){
m_bAsyncRegist = false;
MediaSource::regist();
m_bRegisted = true;
}
}