mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-10-31 08:39:34 +08:00
媒体源注册时强制覆盖
This commit is contained in:
parent
9dfb275ad5
commit
327acdf562
@ -1 +1 @@
|
|||||||
Subproject commit 0d785acfc0069f589b59901cca574ea77422c4da
|
Subproject commit 346e3330f8219fbb5c974a703831a25a01c86656
|
@ -71,15 +71,12 @@ MediaSource::Ptr MediaSource::find(
|
|||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
}
|
}
|
||||||
bool MediaSource::regist() {
|
void MediaSource::regist() {
|
||||||
//注册该源,注册后服务器才能找到该源
|
//注册该源,注册后服务器才能找到该源
|
||||||
bool success;
|
|
||||||
{
|
{
|
||||||
lock_guard<recursive_mutex> lock(g_mtxMediaSrc);
|
lock_guard<recursive_mutex> lock(g_mtxMediaSrc);
|
||||||
auto pr = g_mapMediaSrc[_strSchema][_strVhost][_strApp].emplace(_strId, shared_from_this());
|
g_mapMediaSrc[_strSchema][_strVhost][_strApp][_strId] = shared_from_this();
|
||||||
success = pr.second;
|
|
||||||
}
|
}
|
||||||
if(success){
|
|
||||||
InfoL << _strSchema << " " << _strVhost << " " << _strApp << " " << _strId;
|
InfoL << _strSchema << " " << _strVhost << " " << _strApp << " " << _strId;
|
||||||
NoticeCenter::Instance().emitEvent(Broadcast::kBroadcastMediaChanged,
|
NoticeCenter::Instance().emitEvent(Broadcast::kBroadcastMediaChanged,
|
||||||
true,
|
true,
|
||||||
@ -89,8 +86,6 @@ bool MediaSource::regist() {
|
|||||||
_strId,
|
_strId,
|
||||||
*this);
|
*this);
|
||||||
}
|
}
|
||||||
return success;
|
|
||||||
}
|
|
||||||
bool MediaSource::unregist() {
|
bool MediaSource::unregist() {
|
||||||
//反注册该源
|
//反注册该源
|
||||||
lock_guard<recursive_mutex> lock(g_mtxMediaSrc);
|
lock_guard<recursive_mutex> lock(g_mtxMediaSrc);
|
||||||
|
@ -167,7 +167,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool regist() ;
|
void regist() ;
|
||||||
bool unregist() ;
|
bool unregist() ;
|
||||||
private:
|
private:
|
||||||
template <typename FUN>
|
template <typename FUN>
|
||||||
|
Loading…
Reference in New Issue
Block a user