Skip to content
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

Seeking mode always uses exact seeks, causing slow mouse dragging #250

Closed
2 tasks done
Keith94 opened this issue Nov 23, 2024 · 5 comments · Fixed by #253
Closed
2 tasks done

Seeking mode always uses exact seeks, causing slow mouse dragging #250

Keith94 opened this issue Nov 23, 2024 · 5 comments · Fixed by #253
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@Keith94
Copy link
Contributor

Keith94 commented Nov 23, 2024

mpv Information

built on Nov 20 2024 20:12:23

Reproduction Steps

Compared to other forks like ModernX from zydezu, ModernZ is noticeably more sluggish and struggles while scrubbing through a high bit rate 1080p file; the seek bar "lags" behind while it's trying to follow fast cursor movements.

So far I couldn't find any setting that would remedy that.

Expected Behavior

Equal performance when compared to modernX

Actual Behavior

Sluggish performance

Log File

log.txt

I carefully read all instructions and confirm that I did the following:

  • I tested with the latest mpv version to validate that the issue is not already fixed.
  • I provided all required information.
@Keith94 Keith94 added the bug Something isn't working label Nov 23, 2024
@Samillion Samillion added the help wanted Extra attention is needed label Nov 23, 2024
@Keith94
Copy link
Contributor Author

Keith94 commented Nov 24, 2024

I discovered the seekbar is (seemingly) always using exact seeks, which makes mouse dragging much slower, because the seekbarkeyframes and/or automatickeyframemode options appear to be broken.

So I reverted the commit 53c9d90 by adding back:

local function startupevents()
    if user_opts.automatickeyframemode then
        if mp.get_property_number("duration", 0) > user_opts.automatickeyframelimit then
            user_opts.seekbarkeyframes = true
        else
            user_opts.seekbarkeyframes = false
        end
    end
end

--
-- Other important stuff
mp.register_event("file-loaded", startupevents)

Remove the section:

	if user_opts.automatickeyframemode then
		if mp.get_property_number("duration", 0) > user_opts.automatickeyframelimit then
			user_opts.seekbarkeyframes = true
		else
			user_opts.seekbarkeyframes = false
		end
	end

And dragging is not slow anymore.

@Keith94 Keith94 changed the title Performance while scrubbing is sluggish Seeking mode always uses exact seeks, causing slow mouse dragging Nov 25, 2024
@Samillion
Copy link
Owner

I discovered the seekbar is (seemingly) always using exact seeks, which makes mouse dragging much slower, because the seekbarkeyframes and/or automatickeyframemode options appear to be broken.

So I reverted the commit 53c9d90 by adding back:

local function startupevents()
    if user_opts.automatickeyframemode then
        if mp.get_property_number("duration", 0) > user_opts.automatickeyframelimit then
            user_opts.seekbarkeyframes = true
        else
            user_opts.seekbarkeyframes = false
        end
    end
end

--
-- Other important stuff
mp.register_event("file-loaded", startupevents)

Remove the section:

	if user_opts.automatickeyframemode then
		if mp.get_property_number("duration", 0) > user_opts.automatickeyframelimit then
			user_opts.seekbarkeyframes = true
		else
			user_opts.seekbarkeyframes = false
		end
	end

And dragging is not slow anymore.

Ah, that is a great find. So it's being processed earlier than needed. Thanks for pointing this out, I'll post a fix in a bit to see if it fixes it.

@Samillion
Copy link
Owner

Samillion commented Nov 27, 2024

Could you try this, please:
https://github.com/Samillion/ModernZ/blob/dev_seekmode_fix/modernz.lua

Question: So for your scenario, setting automatickeyframemode to no makes it slow? Because that seems to be the case for me as well.

@Keith94
Copy link
Contributor Author

Keith94 commented Nov 27, 2024

Could you try this, please:
https://github.com/Samillion/ModernZ/blob/dev_seekmode_fix/modernz.lua

Will check later today. Thanks!

Question: So for your scenario, setting automatickeyframemode to no makes it slow? Because that seems to be the case for me as well.

Yep that's right. It will also be slow when seekbarkeyframes is turned off, if automatickeyframemode is also turned off.

@Keith94
Copy link
Contributor Author

Keith94 commented Nov 28, 2024

Everything's working properly now. :) ty

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants