ws-video: video/avi tests (OpenDML / idx1 / scan, PCM / ADPCM / MP2 audio, raw RGB / I420, mux round trip), video/y4m tests (every C tag, 10-bit, writer), empty audio chunks are padding

This commit is contained in:
4DBug committed 2026-10-31 09:45:10 -05:00
1 parent 9411cd97c6
commit d221bb5327
9 files changed
+402 -9

No files matched your search

+5 -2
View File
@@ -163,9 +163,12 @@ end
-- seek(t, v, c, label, at): after seek(at) the next frame is the first at or after `at`
function C.seek(t: any, v: any, c: any, label: string, at: number)
if not c.frames or not Video.canDecode(v.codec) then
if not (c.frames or c.rgba) or not Video.canDecode(v.codec) then
return
end
if v.duration > 0 and at > v.duration * 0.6 then
at = math.floor(v.duration * 50) / 100
end
v:seek(at)
local f, ferr = v:nextFrame()
if not f and ferr and string.find(ferr.message, "inter frames", 1, true) then
@@ -173,7 +176,7 @@ function C.seek(t: any, v: any, c: any, label: string, at: number)
return -- TEMP until ws/video-vp8 merges
end
t:check(f ~= nil and f.pts >= at - 1e-6 and f.pts < at + 0.2, label .. ": seek to " .. at .. " lands at " .. tostring(f and f.pts))
if f and C.EXACT[v.codec] then
if f and C.EXACT[v.codec] and c.frames then
local idx = math.floor(f.pts * v.frameRate + 0.5) + 1
t:eq(Crc32.of(f.image.pixels), c.frames[idx], label .. ": the frame after seeking equals ffmpeg's frame " .. idx)
end