mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-06-18 06:02:21 +08:00
使用static_pointer_cast优化性能
This commit is contained in:
@@ -41,7 +41,7 @@ void RtmpMediaSource::onWrite(RtmpPacket::Ptr pkt, bool /*= true*/)
|
||||
}
|
||||
|
||||
if (!_ring) {
|
||||
std::weak_ptr<RtmpMediaSource> weakSelf = std::dynamic_pointer_cast<RtmpMediaSource>(shared_from_this());
|
||||
std::weak_ptr<RtmpMediaSource> weakSelf = std::static_pointer_cast<RtmpMediaSource>(shared_from_this());
|
||||
auto lam = [weakSelf](int size) {
|
||||
auto strongSelf = weakSelf.lock();
|
||||
if (!strongSelf) {
|
||||
|
||||
Reference in New Issue
Block a user