Skip to content

Commit c51a78d

Browse files
velsinkiWyattBlue
authored andcommitted
Fix VideoFrame.pts typing in tests
Fixes 8485992
1 parent 4e786dd commit c51a78d

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

tests/test_seek.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@ def test_decode_half(self) -> None:
104104
frame_count = 0
105105

106106
for frame in container.decode(video_stream):
107+
assert frame.pts is not None
108+
107109
if current_frame is None:
108110
current_frame = timestamp_to_frame(frame.pts, video_stream)
109111
else:

tests/test_videoframe.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ def test_frame_duration_matches_packet() -> None:
3232
packet_durations.sort(key=lambda x: x[0])
3333

3434
with av.open(fate_suite("h264/interlaced_crop.mp4")) as container:
35-
frame_durations = [(f.pts, f.duration) for f in container.decode(video=0)]
35+
frame_durations = [
36+
(f.pts, f.duration) for f in container.decode(video=0) if f.pts is not None
37+
]
3638
frame_durations.sort(key=lambda x: x[0])
3739

3840
assert len(packet_durations) == len(frame_durations)

0 commit comments

Comments
 (0)