Wholphin/app
dudecuda 5050b087e1
Fix trickplay image grid Y-coordinate calculation (#943) (#1259)
## Description
Issue 943 where trickplay images were misaligned with seek preview
mages. I made a post in issues but figured i'd go ahead and make the
pull request.

per gemini:
In SeekPreviewImage.kt, the code calculates which tile in the grid to
display based on the current timestamp:

val x = (tileIndex % trickPlayInfo.tileWidth) // x position within tile
grid
val y = (tileIndex / trickPlayInfo.tileHeight) // y position <-- BUG IS
HERE
To find the correct row (y) in a grid, you are supposed to divide the
current index by the width of the row (the number of columns), not the
height.

Why this breaks: Let's assume a standard trickplay grid that is 10
images wide (tileWidth = 10) and 5 images tall (tileHeight = 5).

If you are looking at the 12th image (tileIndex = 11), it should be on
Row 1 (the second row).

The code calculates y = 11 / 5 = 2. It skips to Row 2!

Because it divides by the smaller height value, the y coordinate
increases much faster than it should. This causes the preview to
visually "jump" down to future rows prematurely, and then snap back as
the x coordinate resets, causing the exact "flashing back and forth" you
saw with the credits and intros.

### Related issue
Fixes #943

### Testing
Tested in Android TV (Android 9) and it does indeed display proper seek
previews using trickplay images.


## AI or LLM usage
Gemini Pro was used to find and fix this bug.
2026-04-18 17:07:18 -04:00
..
config Add experimental MPV player backend (#161) 2025-11-16 18:46:25 -05:00
schemas/com.github.damontecres.wholphin.data.AppDatabase Add ability to order navigation drawer items (#886) 2026-02-12 19:55:12 -05:00
src Fix trickplay image grid Y-coordinate calculation (#943) (#1259) 2026-04-18 17:07:18 -04:00
.gitignore Set update URL (#8) 2025-10-15 17:17:16 -04:00
build.gradle.kts Integrate with libass-android to support SSA/ASS subtitles in ExoPlayer (#1052) 2026-04-15 17:50:34 -04:00
proguard-rules.pro Enable minify/proguard (#29) 2025-10-17 19:44:36 -04:00