diff --git a/3rdpart/ZLToolKit b/3rdpart/ZLToolKit index 40c09a48..b7fc45de 160000 --- a/3rdpart/ZLToolKit +++ b/3rdpart/ZLToolKit @@ -1 +1 @@ -Subproject commit 40c09a4865026de94cdc1ad874aeba580bf15fdf +Subproject commit b7fc45deae0421a5116de95a4a6eca4798bdecbc diff --git a/src/Rtmp/RtmpSession.cpp b/src/Rtmp/RtmpSession.cpp index 34c35d80..03789a33 100644 --- a/src/Rtmp/RtmpSession.cpp +++ b/src/Rtmp/RtmpSession.cpp @@ -45,7 +45,8 @@ void RtmpSession::onError(const SockException& err) { } GET_CONFIG(uint32_t, continue_push_ms, General::kContinuePushMS); - if (_push_src && continue_push_ms) { + //如果是主动关闭的,那么不延迟注销 + if (_push_src && continue_push_ms && err.getErrCode() != Err_shutdown) { //取消所有权 _push_src_ownership = nullptr; //延时10秒注销流 diff --git a/src/Rtsp/RtspSession.cpp b/src/Rtsp/RtspSession.cpp index f0a7a608..8c504e50 100644 --- a/src/Rtsp/RtspSession.cpp +++ b/src/Rtsp/RtspSession.cpp @@ -87,7 +87,8 @@ void RtspSession::onError(const SockException &err) { } GET_CONFIG(uint32_t, continue_push_ms, General::kContinuePushMS); - if (_push_src && continue_push_ms) { + //如果是主动关闭的,那么不延迟注销 + if (_push_src && continue_push_ms && err.getErrCode() != Err_shutdown) { //取消所有权 _push_src_ownership = nullptr; //延时10秒注销流 diff --git a/webrtc/WebRtcPusher.cpp b/webrtc/WebRtcPusher.cpp index c3604cac..096efd13 100644 --- a/webrtc/WebRtcPusher.cpp +++ b/webrtc/WebRtcPusher.cpp @@ -47,6 +47,8 @@ bool WebRtcPusher::close(MediaSource &sender, bool force) { auto strong_self = weak_self.lock(); if (strong_self) { strong_self->onShutdown(SockException(Err_shutdown, err)); + //主动关闭推流,那么不延时注销 + strong_self->_push_src = nullptr; } }); return true;