Commit ed4291bf by ziyue

Merge branch 'master' of github.com:ZLMediaKit/ZLMediaKit

parents 3ccd48e7 a4411680
...@@ -419,7 +419,8 @@ void MediaSource::regist() { ...@@ -419,7 +419,8 @@ void MediaSource::regist() {
//减小互斥锁临界区 //减小互斥锁临界区
lock_guard<recursive_mutex> lock(s_media_source_mtx); lock_guard<recursive_mutex> lock(s_media_source_mtx);
auto &ref = s_media_source_map[_schema][_vhost][_app][_stream_id]; auto &ref = s_media_source_map[_schema][_vhost][_app][_stream_id];
if (ref.lock()) { // 增加判断, 防止当前流已注册时再次注册
if (ref.lock() && ref.lock().get() != this) {
throw std::invalid_argument("media source already existed:" + _schema + "/" + _vhost + "/" + _app + "/" + _stream_id); throw std::invalid_argument("media source already existed:" + _schema + "/" + _vhost + "/" + _app + "/" + _stream_id);
} }
ref = shared_from_this(); ref = shared_from_this();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论