mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-26 04:31:37 +08:00
解决获取mp4录像文件大小不准的问题:#1173
This commit is contained in:
parent
b4327b9b18
commit
a25e1d6021
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user