diff --git a/src/Record/Recorder.cpp b/src/Record/Recorder.cpp index 9f6300f6..b7ccd05f 100644 --- a/src/Record/Recorder.cpp +++ b/src/Record/Recorder.cpp @@ -31,7 +31,7 @@ string Recorder::getRecordPath(Recorder::type type, const string &vhost, const s } //Here we use the customized file path. if (!customized_path.empty()) { - m3u8FilePath = customized_path + "/hls.m3u8"; + return File::absolutePath(m3u8FilePath, customized_path); } return File::absolutePath(m3u8FilePath, hlsPath); } @@ -46,15 +46,8 @@ string Recorder::getRecordPath(Recorder::type type, const string &vhost, const s } //Here we use the customized file path. if (!customized_path.empty()) { - /*开始删除*/ - // mp4FilePath = customized_path + "/"; - /*删除结束*/ - /*开始添加*/ - //@子悦,你上次说这里为了安全不能跳出目录,但实际操作过程中因为存储挂载位置不由流媒体决定,为了方便保存到挂载存储上,我这边做成可以跳出自已目录,你看是否合适,或者有其他办法可以处理这事 - return customized_path + "/"+mp4FilePath; - /*开始添加*/ + return File::absolutePath(mp4FilePath, customized_path); } - return File::absolutePath(mp4FilePath, recordPath); } default: diff --git a/src/Record/Recorder.h b/src/Record/Recorder.h index fa6e2ac7..d7ec133f 100644 --- a/src/Record/Recorder.h +++ b/src/Record/Recorder.h @@ -45,7 +45,7 @@ public: * @param vhost 虚拟主机 * @param app 应用名 * @param stream_id 流id - * @param customized_path 录像文件保存自定义目录,默认为空则自动生成 + * @param customized_path 录像文件保存自定义根目录,为空则采用配置文件设置 * @return 录制文件绝对路径 */ static string getRecordPath(type type, const string &vhost, const string &app, const string &stream_id,const string &customized_path = ""); @@ -56,7 +56,7 @@ public: * @param vhost 虚拟主机 * @param app 应用名 * @param stream_id 流id - * @param customized_path 录像文件保存自定义目录,默认为空则自动生成 + * @param customized_path 录像文件保存自定义根目录,为空则采用配置文件设置 * @return 对象指针,可能为nullptr */ static std::shared_ptr createRecorder(type type, const string &vhost, const string &app, const string &stream_id, const string &customized_path = ""); @@ -77,7 +77,7 @@ public: * @param vhost 虚拟主机 * @param app 应用名 * @param stream_id 流id - * @param customized_path 录像文件保存自定义目录,默认为空则自动生成 + * @param customized_path 录像文件保存自定义根目录,为空则采用配置文件设置 * @return 成功与否 */ static bool startRecord(type type, const string &vhost, const string &app, const string &stream_id,const string &customized_path);