Fix property observe handler hash handling
This commit is contained in:
parent
ae8770df30
commit
73f2e87f66
5
mpv.py
5
mpv.py
|
@ -462,8 +462,9 @@ class MPV(object):
|
||||||
self.command('script_message_to', target, *args)
|
self.command('script_message_to', target, *args)
|
||||||
|
|
||||||
def observe_property(self, name, handler):
|
def observe_property(self, name, handler):
|
||||||
self._property_handlers[hash(handler)] = handler
|
hashval = c_ulonglong(hash(handler))
|
||||||
_mpv_observe_property(self._event_handle, hash(handler), name.encode(), MpvFormat.STRING)
|
self._property_handlers[hashval.value] = handler
|
||||||
|
_mpv_observe_property(self._event_handle, hashval, name.encode(), MpvFormat.STRING)
|
||||||
|
|
||||||
def unobserve_property(self, handler):
|
def unobserve_property(self, handler):
|
||||||
handlerid = hash(handler)
|
handlerid = hash(handler)
|
||||||
|
|
Loading…
Reference in a new issue