mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-06-18 06:02:21 +08:00
修复断连续推情况下线程迁移导致崩溃的bug:#2283
如果一个MultiMediaSourceMuxer对象上挂载了很多个RtpSender对象, 这些对象会绑定MultiMediaSourceMuxer的OwnerPoller(归属线程), 在断连续推发生时,对应的MultiMediaSourceMuxer对象OwnerPoller线程 将发生变更,导致与RtpSender对象的线程不一致。
This commit is contained in:
@@ -153,6 +153,8 @@ std::shared_ptr<void> MediaSource::getOwnership() {
|
||||
//已经被所有
|
||||
return nullptr;
|
||||
}
|
||||
// 关闭所有rtp推流,确保线程安全
|
||||
stopSendRtp("");
|
||||
weak_ptr<MediaSource> weak_self = shared_from_this();
|
||||
//确保返回的Ownership智能指针不为空,0x01无实际意义
|
||||
return std::shared_ptr<void>((void *) 0x01, [weak_self](void *ptr) {
|
||||
|
||||
Reference in New Issue
Block a user