mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
fix: avoid ffmpeg no-frame error when seeking with nokey
This commit is contained in:
parent
ec178fdb52
commit
39aaeb02e2
1 changed files with 6 additions and 2 deletions
|
|
@ -46,7 +46,7 @@ function M:preload(job)
|
|||
end
|
||||
|
||||
local pic = M.has_pic(meta)
|
||||
local percent = (pic and 0 or 5) + job.skip
|
||||
local percent = (pic and 0 or 10) + job.skip
|
||||
if percent > 95 then
|
||||
ya.emit("peek", { pic and 95 or 90, only_if = job.file.url, upper_bound = true })
|
||||
return false
|
||||
|
|
@ -58,8 +58,12 @@ function M:preload(job)
|
|||
|
||||
if percent ~= 0 then
|
||||
cmd:arg { "-ss", math.floor(meta.format.duration * percent / 100) }
|
||||
else
|
||||
cmd:arg { "-skip_frame", "nokey" }
|
||||
end
|
||||
cmd:arg { "-skip_frame", "nokey", "-i", tostring(job.file.path) }
|
||||
|
||||
cmd:arg { "-i", tostring(job.file.path) }
|
||||
|
||||
if percent == 0 then
|
||||
cmd:arg { "-map", "disp:attached_pic" }
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue