From 827158af7313dff121b83b9d64bc36e84b13451a Mon Sep 17 00:00:00 2001 From: xia-chu <771730766@qq.com> Date: Wed, 3 Feb 2021 15:32:08 +0800 Subject: [PATCH] =?UTF-8?q?=E9=98=B2=E6=AD=A2=E6=9C=AA=E5=BC=80=E5=90=AF?= =?UTF-8?q?=E5=BD=95=E5=88=B6=E5=8A=9F=E8=83=BD=E6=97=B6=EF=BC=8C=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E8=AF=A5=E5=8A=9F=E8=83=BD=E5=AF=BC=E8=87=B4=E7=9A=84?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Record/Recorder.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Record/Recorder.cpp b/src/Record/Recorder.cpp index 54803eae..c281e228 100644 --- a/src/Record/Recorder.cpp +++ b/src/Record/Recorder.cpp @@ -64,19 +64,21 @@ std::shared_ptr Recorder::createRecorder(type type, const st auto ret = std::make_shared(path, enable_vhost ? string(VHOST_KEY) + "=" + vhost : ""); ret->setMediaSource(vhost, app, stream_id); return ret; +#else + throw std::invalid_argument("hls相关功能未打开,请开启ENABLE_HLS宏后编译再测试"); #endif - return nullptr; + } case Recorder::type_mp4: { #if defined(ENABLE_MP4) return std::make_shared(path, vhost, app, stream_id); +#else + throw std::invalid_argument("mp4相关功能未打开,请开启ENABLE_MP4宏后编译再测试"); #endif - return nullptr; } - default: - return nullptr; + default: throw std::invalid_argument("未知的录制类型"); } }