summaryrefslogtreecommitdiff
path: root/mpv.py
diff options
context:
space:
mode:
authorjaseg <code@jaseg.net>2016-08-07 19:49:55 +0200
committerjaseg <code@jaseg.net>2016-08-07 19:49:55 +0200
commit1feab17c1836f756785d206cb808bc08c91f2695 (patch)
tree58d9830be6e63d49847c15568ffb874ed8770632 /mpv.py
parent1bde43a4d81b60b93b5bdabcb3b33d3272b71cc7 (diff)
downloadpython-mpv-1feab17c1836f756785d206cb808bc08c91f2695.tar.gz
python-mpv-1feab17c1836f756785d206cb808bc08c91f2695.tar.bz2
python-mpv-1feab17c1836f756785d206cb808bc08c91f2695.zip
:boom: breaking: Call observe_property handler with correct type arg
Diffstat (limited to 'mpv.py')
-rw-r--r--mpv.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/mpv.py b/mpv.py
index d45682f..5e94c7f 100644
--- a/mpv.py
+++ b/mpv.py
@@ -315,10 +315,12 @@ def _event_loop(event_handle, playback_cond, event_callbacks, property_handlers,
if eid == MpvEventID.PROPERTY_CHANGE:
pc, handlerid = devent['event'], devent['reply_userdata']&0Xffffffffffffffff
if handlerid in property_handlers:
+ name = pc['name']
if 'value' in pc:
- property_handlers[handlerid](pc['name'], pc['value'])
+ proptype, _access = ALL_PROPERTIES[name]
+ property_handlers[handlerid](name, proptype(_ensure_encoding(pc['value'])))
else:
- property_handlers[handlerid](pc['name'], pc['data'], pc['format'])
+ property_handlers[handlerid](name, pc['data'], pc['format'])
if eid == MpvEventID.LOG_MESSAGE and log_handler is not None:
ev = devent['event']
log_handler(ev['level'], ev['prefix'], ev['text'])