From 6008ae157ad5c5143dee02ea6662750416d873cc Mon Sep 17 00:00:00 2001 From: Derek Liu Date: Tue, 14 Mar 2023 19:38:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DaddFFmepgSource=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E5=8F=82=E6=95=B0=E9=9D=9E=E6=B3=95=E6=97=B6=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E6=B8=85=E9=99=A4=E8=AE=B0=E5=BD=95=E8=A1=A8=E7=9A=84?= =?UTF-8?q?bug=20(#2305)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 捕获addFFmepgSource接口参数dst_url解析错误的抛错,通过错误回调返回返回错误,清除s_ffmpegMap表中的无效KEY --- server/FFmpegSource.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/server/FFmpegSource.cpp b/server/FFmpegSource.cpp index 1392d9dc..48fb2cd5 100644 --- a/server/FFmpegSource.cpp +++ b/server/FFmpegSource.cpp @@ -78,7 +78,13 @@ void FFmpegSource::play(const string &ffmpeg_cmd_key, const string &src_url,cons _src_url = src_url; _dst_url = dst_url; _ffmpeg_cmd_key = ffmpeg_cmd_key; - _media_info.parse(dst_url); + + try { + _media_info.parse(dst_url); + } catch (std::exception &ex) { + cb(SockException(Err_other, ex.what())); + return; + } auto ffmpeg_cmd = ffmpeg_cmd_default; if (!ffmpeg_cmd_key.empty()) {