Fix handling of c_void_p args in MpvRenderParam.__init__()

Handling of c_void_p args (x11_display, wl_display) was broken.
Added a case to correctly handle the c_void_p constructor case.
See https://github.com/jaseg/python-mpv/issues/169
This commit is contained in:
Marcel Moreaux 2021-07-19 11:04:31 +02:00 committed by jaseg
parent 03e847d8a1
commit b5f03dd2b7

3
mpv.py
View file

@ -225,6 +225,9 @@ class MpvRenderParam(Structure):
elif cons is bool:
self.value = c_int(int(bool(value)))
self.data = cast(pointer(self.value), c_void_p)
elif cons is c_void_p:
self.value = value
self.data = cast(self.value, c_void_p)
else:
self.value = cons(**value)
self.data = cast(pointer(self.value), c_void_p)