From 3105db35a493853866d5535fdba5939ef136123f Mon Sep 17 00:00:00 2001 From: hixz00 Date: Thu, 14 Jan 2021 11:25:51 +0100 Subject: mpv.py: update: Use ctypes.memmove to speed up --- mpv.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mpv.py b/mpv.py index f42a3be..fa2146e 100644 --- a/mpv.py +++ b/mpv.py @@ -744,7 +744,7 @@ class ImageOverlay: self._buf = create_string_buffer(w*h*4) self._size = img.size - self._buf[:] = out.tobytes('raw', 'BGRA') + ctypes.memmove(self._buf, out.tobytes('raw', 'BGRA'), w*h*4) source = '&' + str(addressof(self._buf)) self.m.overlay_add(self.overlay_id, x, y, source, 0, 'bgra', w, h, stride) -- cgit