Repository navigation
Commit 676f663
fix(nowplaying): decode the cover once, not once a second
`update` runs on the throttled Now-Playing tick, about once a second for the
whole session, and decoded `metadata.artworkData` on every one of them. The
bytes never change during a file, so that is a full image decode per second
for a constant result, and MediaPlayer re-encodes the bitmap on top.
On a file with a poster-sized embedded cover it dominated the process.
Measured on the same A/V with and without one, 25 s window each:
cover, before 18.8% of a core PNG = 60.5% of all running samples
no cover 5.8% of a core PNG = 0%
cover, after 6.0% of a core PNG = 0%
That is the shape reported in AetherPlayer#2: the reporter sees 17-25% for an
mp4 with cover art against about 4% for the engine's own demo on the identical
file, and about 4% for a MKV remux of it, which does not carry the cover in a
form the engine surfaces. The engine was never involved.
Keep the decoded artwork and rebuild it only when the bytes change, which is
the gate `NowPlayingView` already applies to its own copy. Cleared on stop so
a following file cannot inherit the previous cover.
68 tests pass.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01HX5zV3Fcf7Nzq4DYGdXvQE1 parent f20c2f0 commit 676f663
1 file changed
Lines changed: 22 additions & 2 deletions
File tree
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
18 | 29 | | |
19 | 30 | | |
20 | 31 | | |
| |||
52 | 63 | | |
53 | 64 | | |
54 | 65 | | |
55 | | - | |
56 | | - | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
57 | 75 | | |
58 | 76 | | |
59 | 77 | | |
| |||
72 | 90 | | |
73 | 91 | | |
74 | 92 | | |
| 93 | + | |
| 94 | + | |
75 | 95 | | |
76 | 96 | | |
77 | 97 | | |
| |||
0 commit comments