Skip to content

Commit 1088b71

Browse files
lgeigerWyattBlue
authored andcommitted
Only call reformat if necessary
1 parent c8356fc commit 1088b71

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

av/video/frame.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -750,7 +750,7 @@ def to_ndarray(self, channel_last=False, **kwargs):
750750
frames_ctx.sw_format, self.ptr.width, self.ptr.height
751751
).name
752752

753-
frame: VideoFrame = self.reformat(**kwargs)
753+
frame: VideoFrame = self.reformat(**kwargs) if len(kwargs) > 0 else self
754754
if frame.ptr.hw_frames_ctx:
755755
raise ValueError("Cannot convert a hardware frame to numpy directly.")
756756

0 commit comments

Comments
 (0)