mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-06-27 04:22:20 +08:00
优化关闭媒体源相关逻辑: #1963
This commit is contained in:
@@ -569,13 +569,10 @@ void RtmpSession::onSendMedia(const RtmpPacket::Ptr &pkt) {
|
||||
sendRtmp(pkt->type_id, pkt->stream_index, pkt, pkt->time_stamp, pkt->chunk_id);
|
||||
}
|
||||
|
||||
bool RtmpSession::close(MediaSource &sender,bool force) {
|
||||
bool RtmpSession::close(MediaSource &sender) {
|
||||
//此回调在其他线程触发
|
||||
if(!_push_src || (!force && _push_src->totalReaderCount())){
|
||||
return false;
|
||||
}
|
||||
string err = StrPrinter << "close media:" << sender.getUrl() << " " << force;
|
||||
safeShutdown(SockException(Err_shutdown,err));
|
||||
string err = StrPrinter << "close media: " << sender.getUrl();
|
||||
safeShutdown(SockException(Err_shutdown, err));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ private:
|
||||
|
||||
///////MediaSourceEvent override///////
|
||||
// 关闭
|
||||
bool close(MediaSource &sender, bool force) override;
|
||||
bool close(MediaSource &sender) override;
|
||||
// 播放总人数
|
||||
int totalReaderCount(MediaSource &sender) override;
|
||||
// 获取媒体源类型
|
||||
|
||||
Reference in New Issue
Block a user