From c6ed1e96bd330a8c671ce9c14ead5245b60e2123 Mon Sep 17 00:00:00 2001 From: velsinki <40809145+velsinki@users.noreply.github.com> Date: Thu, 18 Sep 2025 17:13:53 +0200 Subject: [PATCH 1/2] Remove VideoFrame.pts stub Since `VideoFrame` does not override the `pts` setter/getter, it can also be `None` here. Instead of writing it out in the stubs, we can just reuse the definition from `Frame` by removing the stub in `VideoFrame`. --- av/video/frame.pyi | 1 - 1 file changed, 1 deletion(-) diff --git a/av/video/frame.pyi b/av/video/frame.pyi index c6868aabc..a7575e3bd 100644 --- a/av/video/frame.pyi +++ b/av/video/frame.pyi @@ -30,7 +30,6 @@ class PictureType(IntEnum): class VideoFrame(Frame): format: VideoFormat - pts: int planes: tuple[VideoPlane, ...] pict_type: int colorspace: int From 654c7a023d3c6d39f75ae46f0d2f4b92023d143c Mon Sep 17 00:00:00 2001 From: velsinki <40809145+velsinki@users.noreply.github.com> Date: Thu, 18 Sep 2025 17:18:47 +0200 Subject: [PATCH 2/2] Allow None in FilterContext.push type stub `None` is correctly handled to signify EOF to the buffer, but this should also be visible in the type stub. --- av/filter/context.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/av/filter/context.pyi b/av/filter/context.pyi index d37febdb9..2350019f3 100644 --- a/av/filter/context.pyi +++ b/av/filter/context.pyi @@ -10,7 +10,7 @@ class FilterContext: ) -> None: ... @property def graph(self) -> Graph: ... - def push(self, frame: Frame) -> None: ... + def push(self, frame: Frame | None) -> None: ... def pull(self) -> Frame: ... def process_command( self, cmd: str, arg: str | None = None, res_len: int = 1024, flags: int = 0