diff --git a/src/Rtmp/RtmpSession.cpp b/src/Rtmp/RtmpSession.cpp index be66dd02..b339a4ff 100644 --- a/src/Rtmp/RtmpSession.cpp +++ b/src/Rtmp/RtmpSession.cpp @@ -223,6 +223,7 @@ void RtmpSession::onCmd_deleteStream(AMFDecoder &dec) { sendStatus({ "level", "status", "code", "NetStream.Unpublish.Success", "description", "Stop publishing." }); + _push_src = nullptr; throw std::runtime_error(StrPrinter << "Stop publishing" << endl); } diff --git a/src/Rtsp/RtspSession.cpp b/src/Rtsp/RtspSession.cpp index 368a575b..bd9e35be 100644 --- a/src/Rtsp/RtspSession.cpp +++ b/src/Rtsp/RtspSession.cpp @@ -875,6 +875,7 @@ void RtspSession::handleReq_Pause(const Parser &parser) { void RtspSession::handleReq_Teardown(const Parser &parser) { sendRtspResponse("200 OK"); + _push_src = nullptr; throw SockException(Err_shutdown,"recv teardown request"); }