summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjaseg <code@jaseg.net>2016-08-04 16:19:36 +0200
committerjaseg <code@jaseg.net>2016-08-04 16:19:36 +0200
commit73f2e87f66a2a5a2e14bb1c8b4a17bbf3eaf27ee (patch)
tree7b4bee1ed2c446977ab896c3133c79a9270d7278
parentae8770df30dbb1b9999777ba084aee14f6504e56 (diff)
downloadpython-mpv-73f2e87f66a2a5a2e14bb1c8b4a17bbf3eaf27ee.tar.gz
python-mpv-73f2e87f66a2a5a2e14bb1c8b4a17bbf3eaf27ee.tar.bz2
python-mpv-73f2e87f66a2a5a2e14bb1c8b4a17bbf3eaf27ee.zip
Fix property observe handler hash handling
-rw-r--r--mpv.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/mpv.py b/mpv.py
index fb1c35a..d49949b 100644
--- a/mpv.py
+++ b/mpv.py
@@ -462,8 +462,9 @@ class MPV(object):
self.command('script_message_to', target, *args)
def observe_property(self, name, handler):
- self._property_handlers[hash(handler)] = handler
- _mpv_observe_property(self._event_handle, hash(handler), name.encode(), MpvFormat.STRING)
+ hashval = c_ulonglong(hash(handler))
+ self._property_handlers[hashval.value] = handler
+ _mpv_observe_property(self._event_handle, hashval, name.encode(), MpvFormat.STRING)
def unobserve_property(self, handler):
handlerid = hash(handler)