确保断连续推功能开启后流能正常强制关闭 (#4287)

This commit is contained in:
xia-chu
2025-06-29 18:09:43 +08:00
parent a35444f27e
commit f0bc7a75aa
2 changed files with 18 additions and 0 deletions

View File

@@ -513,6 +513,18 @@ EventPoller::Ptr MultiMediaSourceMuxer::getOwnerPoller(MediaSource &sender) {
}
}
bool MultiMediaSourceMuxer::close(MediaSource &sender) {
_rtmp = nullptr;
_rtsp = nullptr;
_fmp4 = nullptr;
_ts = nullptr;
_mp4 = nullptr;
_hls = nullptr;
_hls_fmp4 = nullptr;
_rtp_sender.clear();
return true;
}
std::shared_ptr<MultiMediaSourceMuxer> MultiMediaSourceMuxer::getMuxer(MediaSource &sender) const {
return const_cast<MultiMediaSourceMuxer*>(this)->shared_from_this();
}

View File

@@ -181,6 +181,12 @@ public:
* [AUTO-TRANSLATED:a4dc847e]
*/
toolkit::EventPoller::Ptr getOwnerPoller(MediaSource &sender) override;
/**
* 关闭流
* @return 是否成功
*/
bool close(MediaSource &sender) override;
/**
* 获取本对象