summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhixz00 <mr.hixz@gmail.com>2021-01-14 11:25:51 +0100
committerjaseg <136313+jaseg@users.noreply.github.com>2021-01-19 18:59:59 +0100
commit3105db35a493853866d5535fdba5939ef136123f (patch)
tree493542b0c5f8fb3c58d60143946b88179baddd22
parent5e581e817b79e15db814df9139057d1b78558e7a (diff)
downloadpython-mpv-3105db35a493853866d5535fdba5939ef136123f.tar.gz
python-mpv-3105db35a493853866d5535fdba5939ef136123f.tar.bz2
python-mpv-3105db35a493853866d5535fdba5939ef136123f.zip
mpv.py: update: Use ctypes.memmove to speed up
-rw-r--r--mpv.py2
1 files changed, 1 insertions, 1 deletions
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)