-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lagging behind osc decorations #11
Comments
You get the same issue if you block parallel execution, by the time your seek is done, you've hovered on a different part of the timeline. I think the Should update properly once you stop moving the mouse, it'll catch up and display the correct thumbnail for your current position. |
This one took me 25 seconds, sometimes it happens very soon just about 3 seconds. Drifting.Home.2022.1080p.NF.WEB-DL.DUAL.DDP5.1.H.264-SMURF.mkv.-.mpv.2022-09-21.22-36-37_Trim.mp4 |
Haven't looked into internals too much, but can't you execute seek only after the last one is done? And the queued one gets overwritten by new requests. |
log here, looks like subprocess down.
|
Keeping this open until it's confirmed working. |
Still freeze here (windows 10) |
EOF code 6 is PT_ERROR, // play next playlist entry (due to an error) the Lines 346 to 351 in 85a737e
|
White background of thumbnail lags when repeatedly moving on the timeline lag.mp4 |
continue #25 (comment) This one work's pretty unstable, much easier to reproduce this issue. |
Doesn't #36 fix this? I tried it and the freezing had stopped. |
I will try it in few days. no pc right now. The probability is greatly reduced, but not really fixed. |
Yup, after playing around after the pr I noticed this too. |
Can't reproduce on latest commit. |
For me its fixed, however when moving the mouse very fast the white background drags a bit. Doesn't happen when moving the mouse at a steady rate. |
Filters are nearly out of our control in this script... Any vf would probably break the thumbnail. |
@Zabooby Try tomasklaen/uosc#353, it shouldn't have this issue. Comment on that PR if you find anything wrong. |
Sorry I'm dumb, how do I download uosc with the pull request you made? |
Yup its fixed now! Both frames freezing and the background drag. |
I am beginning to understand the deeper reasons why thumbnails can desync. --- a/thumbfast.lua
+++ b/thumbfast.lua
@@ -115,6 +115,8 @@ if options.direct_io then
end
end
+local event_loop_exhausted = false
+
local spawned = false
local network = false
local disabled = false
@@ -607,6 +609,11 @@ end)
file_timer:kill()
local function thumb(time, r_x, r_y, script)
+ if event_loop_exhausted then
+ print("last", x, y)
+ print("curr", r_x, r_y)
+ end
+ event_loop_exhausted = true
if disabled then return end
time = tonumber(time)
@@ -645,6 +652,7 @@ local function clear()
end
local function watch_changes()
+ event_loop_exhausted = false
if not dirty then return end
local old_w = effective_w I managed to trigger this and confirmed we did get updated position values we would've liked to have earlier.
I don't know if long processing is the entirety of all desync cases, but it's certainly a factor. The good news is that there shouldn't be desyncs the other way around, where the UI script is busy and can't catch an event loop. It's still able to run Another observation is that the event loop can enter "idle" more often than the "tick" event is propagated, I haven't yet looked into how they're implemented. Maybe some idle steps are redundant. Please tell me what you know, if I am missing important info. |
Calling From a quick glance it looks like this will break timers, and the fix is implementing a custom event loop. We still have to isolate what's being slow, to place the call there. |
These are the functions that take the longest (worst case):
Stats from
Most of the time in if mp.get_property_number("video-params/rotate", 0) % 180 == 90 then Makes sense. We should avoid querying properties in such a critical function. Call
Storing property changes as they arrive would be better than querying them in These changes should greatly improve the situation. |
I think everything that could be done to address this without fundamentally changing how the script works has been done. |
#5 doesn't completely fix the issue.
The position will now be updated in time, but the frame will still be frozen. Maybe we need to add debounce or lock to make sure there is no parallel execution.
The text was updated successfully, but these errors were encountered: