大幅优化性能

This commit is contained in:
xiongziliang
2018-09-14 18:04:41 +08:00
parent 237a7d71f3
commit 492d083f5b
12 changed files with 60 additions and 35 deletions

View File

@@ -192,13 +192,16 @@ void PlayerProxy::initMedia() {
bool PlayerProxy::shutDown() {
//通知其停止推流
weak_ptr<PlayerProxy> weakSlef = dynamic_pointer_cast<PlayerProxy>(shared_from_this());
ASYNC_TRACE([weakSlef](){
auto stronSelf = weakSlef.lock();
if(stronSelf){
stronSelf->m_pChn.reset();
stronSelf->teardown();
}
});
auto executor = getExecutor();
if(executor) {
executor->async_first([weakSlef]() {
auto stronSelf = weakSlef.lock();
if (stronSelf) {
stronSelf->m_pChn.reset();
stronSelf->teardown();
}
});
}
return true;
}