Commit 9fd0db55 by 夏楚 Committed by GitHub

Merge pull request #1730 from Dw9/patch-1

Update MP4Recorder.cpp
parents ca66858d 1c5380ee
......@@ -73,6 +73,8 @@ void MP4Recorder::asyncClose() {
info.time_len = (float) (::time(NULL) - info.start_time);
//关闭mp4非常耗时,所以要放在后台线程执行
muxer->closeMP4();
if(!full_path_tmp.empty()) {
//获取文件大小
info.file_size = File::fileSize(full_path_tmp.data());
if (info.file_size < 1024) {
......@@ -82,6 +84,7 @@ void MP4Recorder::asyncClose() {
}
//临时文件名改成正式文件名,防止mp4未完成时被访问
rename(full_path_tmp.data(), full_path.data());
}
/////record 业务逻辑//////
NoticeCenter::Instance().emitEvent(Broadcast::kBroadcastRecordMP4, info);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论