Commit f1438986 by xia-chu

修复stopSendRtp后无法触发无人观看事件的问题

parent a93a985a
...@@ -389,12 +389,11 @@ void MultiMediaSourceMuxer::createGopCacheIfNeed() { ...@@ -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());
}); });
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论