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

Only one getVideoOutParams #814

Merged
merged 2 commits into from
May 11, 2024
Merged

Conversation

moffatman
Copy link
Contributor

Just a little optimization, because these calls to MPVHelpers.getVideoOutParams are not allowed at this time (in render callback), it causes some jank (at end of looping video is most obvious). Personally I work around it by eagerly using setSize. However, we can also take a simple optimization to avoid calling it twice for both width and height when it returns both.

@moffatman moffatman requested a review from birros May 11, 2024 04:03
Copy link
Member

@birros birros left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Indeed, I agree.

@birros birros merged commit 58a473f into media-kit:main May 11, 2024
19 checks passed
width: Double(width ?? (params.rotate == 0 || params.rotate == 180
? params.dh
: params.dw)),
height: Double(height ?? (params.rotate == 0 || params.rotate == 180
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@moffatman seems like a mistake?
Previously: width = params.rotate == 0 || params.rotate == 180 ? dw : dh
Now it's: width = params.rotate == 0 || params.rotate == 180 ? dh : dw (swapped)
Same for height.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whoops #814

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants