video: yields before the rgba / scale conversion and between a new H.264 picture's planes; build/ regenerated

This commit is contained in:
4DBug committed 2026-11-02 22:05:24 -06:00
1 parent 0b2d8774b9
commit 7ea8498f78
9 files changed
+2961 -1511

No files matched your search

@@ -84,6 +84,9 @@ local function newPicture(self: any, sps: any): any
local hook = self.opts.yield
local y = buffer.create(ys * (h + 2 * PAD))
local u, v = buffer.create(cs * (h // 2 + 2 * PADC)), buffer.create(cs * (h // 2 + 2 * PADC))
if hook then
pcall(hook)
end
local ref0, ref1 = table.create(n4, -1), table.create(n4, -1)
if hook then
pcall(hook)
+5 -1
View File
@@ -202,7 +202,7 @@ local function vp8Decoder(_track: Types.Track, opts: any?): (Types.VideoCodecDec
else
dec = Vp8.newDecoder()
end
end)
end) :: any
self.skipped = 0
function self.release(_: any, image: Types.Image): boolean
return dec:release(image)
@@ -485,6 +485,10 @@ function Video.open(demuxer: Types.Demuxer, opts: OpenOptions?): (Types.VideoDec
end
lastPts = t
local maxSide = o.maxSide
local hook = o.yield
if hook and (o.rgba or maxSide) then
pcall(hook)
end
if maxSide and maxSide >= 1 and img.format == "yuv420p" and math.max(img.width, img.height) > maxSide then
local s = maxSide / math.max(img.width, img.height)
local dw, dh = math.max(1, math.floor(img.width * s + 0.5)), math.max(1, math.floor(img.height * s + 0.5))