feat(Android): Implement refresh rate matching for native player#997
feat(Android): Implement refresh rate matching for native player#997TwoToneEddy wants to merge 5 commits into
Conversation
|
Thanks for taking a look. I have since added a soundbar to my system which passes through the HDMI. Since using this rather than direct to the TV I am noticing some issues with what I believe to be handshaking. I will investigate this over the next week an hopefully fix, along with your suggestion. Thanks |
|
Seems to work reliably now with my soundbar so OK to merge once we sort those conflicts |
The video texture was being released while still visible during the pop animation. closePlayer() now awaits endOfFrame before navigating so the widget tree can rebuild first, and the video widget hides itself when VideoPlayerState.disposed is set.
Resetting the refresh rate fire-and-forget in onDestroy raced the activity teardown: the HDMI link retrained while the surface was being destroyed, which could black out pass-through soundbar/AVR chains until a power cycle. applyRefreshRate now returns the previous mode id, and finish() is overridden to switch back to that mode and wait for the change to settle (display listener + non-seamless delay) while the window is still alive, only then completing the finish. onDestroy keeps a fire-and-forget reset as a fallback. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
android.builtInKotlin and android.newDsl were inserted by a newer Flutter checkout's migrator before the project was built with the pinned 3.35.7, which doesn't reference them. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
OK i've done a rebase, everything seems to build and work still. Hopefully this is all OK |
There was a problem hiding this comment.
Looks good to me thanks for implementing this. You do seem to have claude co-authored in the 2 latest commits. While I don't mind using AI, the co-authoring label is something I would like to prevent. If you could clean that up that would be great.
Pull Request Description
Ports refresh rate matching from the native Android TV client to Fladder's native player backend on Android. When a video begins playing, the display refresh rate is switched to match the video's frame rate using
Surface.setFrameRate()/Windowpreferred display mode. Playback pauses during the mode switch and resumes automatically once the display has settled. A toggle to enable/disable the feature is added to player settings.Also fixes a visual artifact on player exit where the video texture was released mid-frame during the pop animation, causing the top-left quadrant of the video to flash briefly in the bottom-right of the UI.
closePlayer()now awaitsendOfFramebefore navigating so the widget tree can rebuild and cleanly detach the texture first.Tested On
Checklist