优化获取播放器列表相关功能

This commit is contained in:
xia-chu
2023-09-02 12:06:35 +08:00
parent d286ac1d73
commit 39dd886ec1
15 changed files with 68 additions and 27 deletions

View File

@@ -224,7 +224,11 @@ void SrtTransportImp::doPlay() {
ts_src->pause(false);
strong_self->_ts_reader = ts_src->getRing()->attach(strong_self->getPoller());
weak_ptr<Session> weak_session = strong_self->getSession();
strong_self->_ts_reader->setGetInfoCB([weak_session]() { return weak_session.lock(); });
strong_self->_ts_reader->setGetInfoCB([weak_session]() {
Any ret;
ret.set(static_pointer_cast<SockInfo>(weak_session.lock()));
return ret;
});
strong_self->_ts_reader->setDetachCB([weak_self]() {
auto strong_self = weak_self.lock();
if (!strong_self) {