From 4a7f5796ba3d2a8480ddecb6cd65b15e17455ca6 Mon Sep 17 00:00:00 2001 From: ziyue <1213642868@qq.com> Date: Wed, 23 Feb 2022 17:01:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dts=E6=96=87=E4=BB=B6=E5=A4=A7?= =?UTF-8?q?=E4=BA=8E3GB=E6=97=B6=EF=BC=8C=E8=8E=B7=E5=8F=96=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E5=A4=A7=E5=B0=8F=E5=BC=82=E5=B8=B8=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Record/HlsMakerImp.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Record/HlsMakerImp.cpp b/src/Record/HlsMakerImp.cpp index 5e73a54b..525e64b5 100644 --- a/src/Record/HlsMakerImp.cpp +++ b/src/Record/HlsMakerImp.cpp @@ -136,9 +136,7 @@ void HlsMakerImp::onFlushLastSegment(uint32_t duration_ms) { GET_CONFIG(bool, broadcastRecordTs, Hls::kBroadcastRecordTs); if (broadcastRecordTs) { _info.time_len = duration_ms / 1000.0f; - struct stat fileData; - stat(_info.file_path.data(), &fileData); - _info.file_size = fileData.st_size; + _info.file_size = File::fileSize(_info.file_path.data()); NoticeCenter::Instance().emitEvent(Broadcast::kBroadcastRecordTs, _info); } }