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

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

@@ -857,7 +857,11 @@ void RtspSession::handleReq_Play(const Parser &parser) {
if (!_play_reader && _rtp_type != Rtsp::RTP_MULTICAST) {
weak_ptr<RtspSession> weak_self = static_pointer_cast<RtspSession>(shared_from_this());
_play_reader = play_src->getRing()->attach(getPoller(), use_gop);
_play_reader->setGetInfoCB([weak_self]() { return weak_self.lock(); });
_play_reader->setGetInfoCB([weak_self]() {
Any ret;
ret.set(static_pointer_cast<SockInfo>(weak_self.lock()));
return ret;
});
_play_reader->setDetachCB([weak_self]() {
auto strong_self = weak_self.lock();
if (!strong_self) {