Frame rate from the library, so the TV switches before the first frame

PlaybackInfo's RealFrameRate (or AverageFrameRate) is carried in the plan, and the
provider contract gains an optional frameRate that every provider can fill (Plex
and local files later); without it the first frames are measured as before. Full
screen is a dialog, so the preference is set on the dialog's window as well as
the activity's. Still off unless the frame-rate switch is on.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-09 17:34:14 +00:00
co-authored by Claude Opus 5.5
parent a6d2f2c33c
commit 8ec7141218
5 changed files with 41 additions and 11 deletions
@@ -67,4 +67,14 @@ class PlayerSwitchesTest {
assertEquals("video/x-ms-mpeg4", videoMimeFor("msmpeg4v3"))
assertEquals("video/mp4v-es", videoMimeFor("xvid"))
}
@Test fun theLibrarysFrameRateIsRead() {
fun streams(vararg video: Pair<String, Double>) = org.json.JSONArray().put(org.json.JSONObject().put("Type", "Audio"))
.put(org.json.JSONObject().put("Type", "Video").apply { video.forEach { (k, v) -> put(k, v) } })
assertEquals(23.976f, streamFrameRate(streams("RealFrameRate" to 23.976, "AverageFrameRate" to 23.9))!!, 0.0001f)
assertEquals(25f, streamFrameRate(streams("AverageFrameRate" to 25.0))!!, 0.0001f)
assertNull(streamFrameRate(streams("RealFrameRate" to 1000.0)))
assertNull(streamFrameRate(streams()))
assertNull(streamFrameRate(null))
}
}