无metadata且不能获取Track的rtmp确保能注册

This commit is contained in:
xiongziliang 2020-05-28 18:01:03 +08:00
parent 41509800bc
commit 406c5477e0
2 changed files with 11 additions and 4 deletions

View File

@ -107,6 +107,14 @@ public:
} }
} }
/**
* metadata
*/
void updateMetaData(const AMFValue &metadata) {
lock_guard<recursive_mutex> lock(_mtx);
_metadata = metadata;
}
/** /**
* rtmp包 * rtmp包
* @param pkt rtmp包 * @param pkt rtmp包

View File

@ -53,9 +53,8 @@ public:
//该metadata无效需要重新生成 //该metadata无效需要重新生成
_metadata = metadata; _metadata = metadata;
_recreate_metadata = true; _recreate_metadata = true;
}else{
RtmpMediaSource::setMetaData(metadata);
} }
RtmpMediaSource::setMetaData(metadata);
} }
/** /**
@ -158,8 +157,8 @@ public:
_all_track_ready = true; _all_track_ready = true;
if(_recreate_metadata){ if(_recreate_metadata){
//需要重新生成metadata //更新metadata
RtmpMediaSource::setMetaData(_metadata); RtmpMediaSource::updateMetaData(_metadata);
} }
} }