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

A small Frame Rate Matching bug #642

Closed
chillout23 opened this issue Nov 15, 2023 · 3 comments
Closed

A small Frame Rate Matching bug #642

chillout23 opened this issue Nov 15, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@chillout23
Copy link

chillout23 commented Nov 15, 2023

tvOS:

In Tracy Player and other apps where KSPlayer is used, frame rate matching is working fine but;

If you open stream = frame rate matches.
If you exit stream = frame rate goes back to default.
If you open same stream again in 1-2 second (quickly) = framerate does not match.
Note: It works again if I wait 5-10 seconds or more.

Frame rate matching in KSPlayer is sensitive to how quickly you exit / enter stream.

Sounds maybe like a quick fix @kingslay if you can look into it.

@chillout23 chillout23 added the bug Something isn't working label Nov 15, 2023
@kingslay
Copy link
Owner

有这么奇怪的问题啊。你可以看下第二次快速进入的时候,有没有调用
displayManager.preferredDisplayCriteria = AVDisplayCriteria(refreshRate: refreshRate, videoDynamicRange: dynamicRange.rawValue)
这个方法。并且看下是不是 下面这个方法太晚调用了。导致设置的值被清空了。这个方法是在deinit的时候调用的。所以无法控制时间点。

open func playerLayerDeinit() {
        #if os(tvOS) || os(xrOS)
        UIApplication.shared.windows.first?.avDisplayManager.preferredDisplayCriteria = nil
        #endif
    }

@chillout23
Copy link
Author

Thanks @kingslay, were you able to reproduce this yourself by doing the steps?

@chillout23
Copy link
Author

@kingslay very elegant way to fix this, now it's 100% stable - well done!

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

No branches or pull requests

2 participants