mirror of https://github.com/mpv-player/mpv
lua: execute idle handlers after timers have been processed
Idle handlers used to not be executed when timers were active Now they are executed: * After all expired timers have been executed * After all events have been processed (same as when there are no timers)
This commit is contained in:
parent
c681fc133c
commit
9be68e49b2
|
@ -476,12 +476,9 @@ function mp.dispatch_events(allow_wait)
|
|||
while mp.keep_running do
|
||||
local wait = 0
|
||||
if not more_events then
|
||||
wait = process_timers()
|
||||
if wait == nil then
|
||||
for _, handler in ipairs(idle_handlers) do
|
||||
handler()
|
||||
end
|
||||
wait = 1e20 -- infinity for all practical purposes
|
||||
wait = process_timers() or 1e20 -- infinity for all practical purposes
|
||||
for _, handler in ipairs(idle_handlers) do
|
||||
handler()
|
||||
end
|
||||
-- Resume playloop - important especially if an error happened while
|
||||
-- suspended, and the error was handled, but no resume was done.
|
||||
|
|
Loading…
Reference in New Issue