Commit 121b78e5 by xiongziliang

推流器主动断开时,避免开启断流续推功能

parent 7a24a226
...@@ -219,10 +219,11 @@ void RtmpSession::onCmd_publish(AMFDecoder &dec) { ...@@ -219,10 +219,11 @@ void RtmpSession::onCmd_publish(AMFDecoder &dec) {
} }
void RtmpSession::onCmd_deleteStream(AMFDecoder &dec) { void RtmpSession::onCmd_deleteStream(AMFDecoder &dec) {
_push_src = nullptr;
//此时回复可能触发broken pipe事件,从而直接触发onError回调;所以需要先把_push_src置空,防止触发断流续推功能
sendStatus({ "level", "status", sendStatus({ "level", "status",
"code", "NetStream.Unpublish.Success", "code", "NetStream.Unpublish.Success",
"description", "Stop publishing." }); "description", "Stop publishing." });
_push_src = nullptr;
throw std::runtime_error(StrPrinter << "Stop publishing" << endl); throw std::runtime_error(StrPrinter << "Stop publishing" << endl);
} }
......
...@@ -867,8 +867,9 @@ void RtspSession::handleReq_Pause(const Parser &parser) { ...@@ -867,8 +867,9 @@ void RtspSession::handleReq_Pause(const Parser &parser) {
} }
void RtspSession::handleReq_Teardown(const Parser &parser) { void RtspSession::handleReq_Teardown(const Parser &parser) {
sendRtspResponse("200 OK");
_push_src = nullptr; _push_src = nullptr;
//此时回复可能触发broken pipe事件,从而直接触发onError回调;所以需要先把_push_src置空,防止触发断流续推功能
sendRtspResponse("200 OK");
throw SockException(Err_shutdown,"recv teardown request"); throw SockException(Err_shutdown,"recv teardown request");
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论