From 89d400dc21881e63fda20e23b11a88bca6ee49d6 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 8 Apr 2014 22:06:39 +0200 Subject: client API: avoid redundant property change events if possible This is done simply by comparing the previous and current values. Do this only if the requested format is not MPV_FORMAT_NONE. --- DOCS/man/en/lua.rst | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'DOCS') diff --git a/DOCS/man/en/lua.rst b/DOCS/man/en/lua.rst index 5b07ebe0ce..e88f4a9c2c 100644 --- a/DOCS/man/en/lua.rst +++ b/DOCS/man/en/lua.rst @@ -250,13 +250,17 @@ The ``mp`` module is preloaded, although it can be loaded manually with example ``string``, ``fn`` is roughly called as in ``fn(name, mp.get_property_string(name))``. - Sporadic property change events are possible. This means the change function - ``fn`` can be called even if the property doesn't actually change. Likewise, - in some cases the function is not called even if the property changes. If - possible, change events are coalesced. If a property is changed a bunch of - times in a row, only the last change triggers the change function. (The + If possible, change events are coalesced. If a property is changed a bunch + of times in a row, only the last change triggers the change function. (The exact behavior depends on timing and other things.) + In some cases the function is not called even if the property changes. + Whether this can happen depends on the property. + + If the ``type`` is ``none`` or ``nil``, sporadic property change events are + possible. This means the change function ``fn`` can be called even if the + property doesn't actually change. + ``mp.unobserve_property(fn)`` Undo ``mp.observe_property(..., fn)``. This removes all property handlers that are equal to the ``fn`` parameter. This uses normal Lua ``==`` -- cgit v1.2.3