修改注释

This commit is contained in:
nnwang
2026-02-22 04:56:01 +08:00
parent 64573e29ef
commit 5a6fa242dd

View File

@@ -188,10 +188,10 @@ end
-- 分批下载(每批 50 帧) -- 分批下载(每批 50 帧)
local BATCH_SIZE = 20 local BATCH_SIZE = 20
-- local totalFrames = #videoInfo.frame_urls -- local totalFrames = #videoInfo.frame_urls
local totalFrames = videoInfo.fps * 20 -- 仅下载前10秒以节省时间 local totalFrames = videoInfo.fps * 20 -- 仅下载前20秒以节省时间
local allFrameData = {} local allFrameData = {}
-- 第一步:构建所有需要下载的批次(仅前10秒 -- 第一步:构建所有需要下载的批次(仅前20秒
local initBatches = {} local initBatches = {}
for startIdx = 1, totalFrames, BATCH_SIZE do for startIdx = 1, totalFrames, BATCH_SIZE do
local endIdx = math.min(startIdx + BATCH_SIZE - 1, totalFrames) local endIdx = math.min(startIdx + BATCH_SIZE - 1, totalFrames)
@@ -257,7 +257,7 @@ until _G.audio_ready
local starttime1 = os.clock() local starttime1 = os.clock()
-- 播放前已缓存 10 秒 -- 播放前已缓存 20 秒
local totalFramesToPlay = #videoInfo.frame_urls local totalFramesToPlay = #videoInfo.frame_urls
-- 标志:是否还在播放 -- 标志:是否还在播放
@@ -415,9 +415,10 @@ local function renderVideo()
local data = allFrameData[frameIndex] local data = allFrameData[frameIndex]
-- === 如果 data 存在才进行解码和渲染 === -- === 如果 data 存在才进行解码和渲染 否则跳帧 ===
if data then if data then
-- 将字符串转换为字节表 -- 将字符串转换为字节表
-- 感谢来自 https://center.mcmod.cn/1288558/ 提供高性能解码方案
local imgBin = { data:byte(1, #data) } local imgBin = { data:byte(1, #data) }
data = nil data = nil