mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-06-15 04:25:58 +08:00
优化关闭媒体源相关逻辑: #1963
This commit is contained in:
@@ -124,13 +124,10 @@ void RtpSession::onRtpPacket(const char *data, size_t len) {
|
||||
_ticker.resetTime();
|
||||
}
|
||||
|
||||
bool RtpSession::close(MediaSource &sender, bool force) {
|
||||
bool RtpSession::close(MediaSource &sender) {
|
||||
//此回调在其他线程触发
|
||||
if(!_process || (!force && static_pointer_cast<MediaSourceEvent>(_process)->totalReaderCount(sender))){
|
||||
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