From fe67aa7b1878ca3cf3bf81dcafa1bbe3efaf51c8 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 18 Mar 2016 22:03:04 +0100 Subject: lua: don't suspend core by default during script execution This changes behavior somewhat. The old behavior can be restored by running "mp.use_suspend=true". It was originally introduced for the OSC, but I can't reproduce whatever misbehavior I was seeing. (See mp.suspend()/resume() for explanations what the suspend mechanism does.) --- DOCS/interface-changes.rst | 1 + DOCS/man/lua.rst | 8 +------- player/lua/defaults.lua | 2 +- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/DOCS/interface-changes.rst b/DOCS/interface-changes.rst index 377d3efbb0..4ef60aa312 100644 --- a/DOCS/interface-changes.rst +++ b/DOCS/interface-changes.rst @@ -23,6 +23,7 @@ Interface changes - deprecate "track-list/N/audio-channels" property (use "track-list/N/demux-channel-count" instead) - remove write access to "stream-pos", and change semantics for read access + - Lua scripts now don't suspend mpv by default while script code is run --- mpv 0.16.0 --- - change --audio-channels default to stereo (use --audio-channels=auto to get the old default) diff --git a/DOCS/man/lua.rst b/DOCS/man/lua.rst index 4d47774319..245eb58a5d 100644 --- a/DOCS/man/lua.rst +++ b/DOCS/man/lua.rst @@ -412,7 +412,7 @@ are useful only in special situations. from displaying the next video frame, so that you don't get blocked when trying to access the player. - This is automatically called by the event handler. + Before mpv 0.17.0, this was automatically called by the event handler. ``mp.resume()`` Undo one ``mp.suspend()`` call. ``mp.suspend()`` increments an internal @@ -423,10 +423,6 @@ are useful only in special situations. This resets the internal suspend counter and resumes the player. (It's like calling ``mp.resume()`` until the player is actually resumed.) - You might want to call this if you're about to do something that takes a - long time, but doesn't really need access to the player (like a network - operation). Note that you still can access the player at any time. - ``mp.get_wakeup_pipe()`` Calls ``mpv_get_wakeup_pipe()`` and returns the read end of the wakeup pipe. (See ``client.h`` for details.) @@ -449,8 +445,6 @@ are useful only in special situations. ``mp.get_wakeup_pipe()`` if you're interested in properly working notification of new events and working timers. - This function calls ``mp.suspend()`` and ``mp.resume_all()`` on its own. - ``mp.enable_messages(level)`` Set the minimum log level of which mpv message output to receive. These messages are normally printed to the terminal. By calling this function, diff --git a/player/lua/defaults.lua b/player/lua/defaults.lua index d0ef57cccd..38905a610b 100644 --- a/player/lua/defaults.lua +++ b/player/lua/defaults.lua @@ -438,7 +438,7 @@ local function call_event_handlers(e) end end -mp.use_suspend = true +mp.use_suspend = false function mp.dispatch_events(allow_wait) local more_events = true -- cgit v1.2.3