Commit 0b79de9d by ziyue

MediaSource: 禁止重复推送一个已经注册的流

parent afdc5e42
......@@ -418,7 +418,11 @@ void MediaSource::regist() {
{
//减小互斥锁临界区
lock_guard<recursive_mutex> lock(s_media_source_mtx);
s_media_source_map[_schema][_vhost][_app][_stream_id] = shared_from_this();
auto &ref = s_media_source_map[_schema][_vhost][_app][_stream_id];
if (ref.lock()) {
throw std::invalid_argument("media source already existed:" + _schema + "/" + _vhost + "/" + _app + "/" + _stream_id);
}
ref = shared_from_this();
}
emitEvent(true);
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论