mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-22 10:40:05 +08:00
提升rtp组播线程安全性
This commit is contained in:
parent
db1e850ef3
commit
a88531354a
@ -156,7 +156,11 @@ string RtpBroadCaster::getIP(){
|
|||||||
}
|
}
|
||||||
RtpBroadCaster::Ptr RtpBroadCaster::make(const EventPoller::Ptr &poller,const string &strLocalIp,const string &strVhost,const string &strApp,const string &strStream){
|
RtpBroadCaster::Ptr RtpBroadCaster::make(const EventPoller::Ptr &poller,const string &strLocalIp,const string &strVhost,const string &strApp,const string &strStream){
|
||||||
try{
|
try{
|
||||||
auto ret = Ptr(new RtpBroadCaster(poller,strLocalIp,strVhost,strApp,strStream));
|
auto ret = Ptr(new RtpBroadCaster(poller,strLocalIp,strVhost,strApp,strStream),[poller](RtpBroadCaster *ptr){
|
||||||
|
poller->async([ptr]() {
|
||||||
|
delete ptr;
|
||||||
|
});
|
||||||
|
});
|
||||||
lock_guard<recursive_mutex> lck(g_mtx);
|
lock_guard<recursive_mutex> lck(g_mtx);
|
||||||
string strKey = StrPrinter << strLocalIp << " " << strVhost << " " << strApp << " " << strStream << endl;
|
string strKey = StrPrinter << strLocalIp << " " << strVhost << " " << strApp << " " << strStream << endl;
|
||||||
weak_ptr<RtpBroadCaster> weakPtr = ret;
|
weak_ptr<RtpBroadCaster> weakPtr = ret;
|
||||||
|
Loading…
Reference in New Issue
Block a user