修复addFFmepgSource接口参数非法时无法清除记录表的bug (#2305)

捕获addFFmepgSource接口参数dst_url解析错误的抛错,通过错误回调返回返回错误,清除s_ffmpegMap表中的无效KEY
This commit is contained in:
Derek Liu 2023-03-14 19:38:24 +08:00 committed by GitHub
parent 70ad9cb0b6
commit 6008ae157a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -78,7 +78,13 @@ void FFmpegSource::play(const string &ffmpeg_cmd_key, const string &src_url,cons
_src_url = src_url; _src_url = src_url;
_dst_url = dst_url; _dst_url = dst_url;
_ffmpeg_cmd_key = ffmpeg_cmd_key; _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; auto ffmpeg_cmd = ffmpeg_cmd_default;
if (!ffmpeg_cmd_key.empty()) { if (!ffmpeg_cmd_key.empty()) {