mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-26 12:37:09 +08:00
修复stopSendRtp后无法触发无人观看事件的问题
This commit is contained in:
parent
a93a985ae5
commit
f1438986ad
@ -389,12 +389,11 @@ void MultiMediaSourceMuxer::createGopCacheIfNeed() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
weak_ptr<MultiMediaSourceMuxer> weak_self = shared_from_this();
|
weak_ptr<MultiMediaSourceMuxer> weak_self = shared_from_this();
|
||||||
_ring = std::make_shared<RingType>(1024, [weak_self](int size) {
|
auto src = std::make_shared<MediaSourceForMuxer>(weak_self.lock());
|
||||||
auto strong_self = weak_self.lock();
|
_ring = std::make_shared<RingType>(1024, [weak_self, src](int size) {
|
||||||
if (strong_self) {
|
if (auto strong_self = weak_self.lock()) {
|
||||||
// 切换到归属线程
|
// 切换到归属线程
|
||||||
strong_self->getOwnerPoller(MediaSource::NullMediaSource())->async([=]() {
|
strong_self->getOwnerPoller(MediaSource::NullMediaSource())->async([=]() {
|
||||||
auto src = std::make_shared<MediaSourceForMuxer>(strong_self);
|
|
||||||
strong_self->onReaderChanged(*src, strong_self->totalReaderCount());
|
strong_self->onReaderChanged(*src, strong_self->totalReaderCount());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user