mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-06-16 13:05:59 +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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user