diff --git a/server/WebApi.cpp b/server/WebApi.cpp index 51afc9e5..0064a462 100644 --- a/server/WebApi.cpp +++ b/server/WebApi.cpp @@ -837,7 +837,9 @@ void installWebApi() { throw ApiRetException("该媒体流不存在", API::OtherFailed); } - val["result"] = src->stopSendRtp(); + if (!src->stopSendRtp()) { + throw ApiRetException("尚未开始推流,停止失败", API::OtherFailed); + } });