Commit a25e1d60 by ziyue

解决获取mp4录像文件大小不准的问题:#1173

parent b4327b9b
...@@ -74,10 +74,12 @@ void MP4Recorder::asyncClose() { ...@@ -74,10 +74,12 @@ void MP4Recorder::asyncClose() {
muxer->closeMP4(); muxer->closeMP4();
//获取文件大小 //获取文件大小
struct stat fileData; auto fp = fopen(full_path_tmp.data(), "rb");
stat(full_path_tmp.data(), &fileData); assert(fp);
info.file_size = fileData.st_size; info.file_size = File::fileSize(fp);
if (fileData.st_size < 1024) { fclose(fp);
if (info.file_size < 1024) {
//录像文件太小,删除之 //录像文件太小,删除之
File::delete_file(full_path_tmp.data()); File::delete_file(full_path_tmp.data());
return; return;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论