summaryrefslogtreecommitdiff
path: root/mpv.py
diff options
context:
space:
mode:
authorjaseg <code@jaseg.net>2016-08-04 16:38:25 +0200
committerjaseg <code@jaseg.net>2016-08-04 16:38:25 +0200
commit0c5530aa271cb2701205264dab4e8394ed76e185 (patch)
tree7f13a77f74b5fc45479c1ca39bfcfb6283e49c65 /mpv.py
parent588d74938c2fe84df0aed966a014faf82939db60 (diff)
downloadpython-mpv-0c5530aa271cb2701205264dab4e8394ed76e185.tar.gz
python-mpv-0c5530aa271cb2701205264dab4e8394ed76e185.tar.bz2
python-mpv-0c5530aa271cb2701205264dab4e8394ed76e185.zip
Fix log handling
Diffstat (limited to 'mpv.py')
-rw-r--r--mpv.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/mpv.py b/mpv.py
index f121c8d..9c6ee5f 100644
--- a/mpv.py
+++ b/mpv.py
@@ -283,7 +283,7 @@ def load_lua():
CDLL('liblua.so', mode=RTLD_GLOBAL)
-def _event_loop(event_handle, playback_cond, event_callbacks, property_handlers):
+def _event_loop(event_handle, playback_cond, event_callbacks, property_handlers, log_handler):
for event in _event_generator(event_handle):
try:
devent = event.as_dict() # copy data from ctypes
@@ -329,7 +329,8 @@ class MPV(object):
self._property_handlers = {}
self._playback_cond = threading.Condition()
self._event_handle = _mpv_create_client(self.handle, b'mpv-python-event-handler-thread')
- loop = partial(_event_loop, self._event_handle, self._playback_cond, self.event_callbacks, self._property_handlers)
+ loop = partial(_event_loop,
+ self._event_handle, self._playback_cond, self.event_callbacks, self._property_handlers, log_handler)
self._event_thread = threading.Thread(target=loop, name='MPVEventHandlerThread')
self._event_thread.setDaemon(True)
self._event_thread.start()
@@ -352,7 +353,7 @@ class MPV(object):
self._event_thread.join()
def set_loglevel(self, level):
- _mpv_request_log_messages(self.handle, level.encode())
+ _mpv_request_log_messages(self._event_handle, level.encode())
def command(self, name, *args):
""" Execute a raw command """