The TimelineView re-rendered both mini player lines every frame (~17% of
the main thread on an iPhone 12 mini, even while paused). The text is now
drawn once in a hosted view and a repeating keyframe animation slides its
layer in the render server. macOS keeps the TimelineView.
- MPVRenderView keeps its display link paused while the stream has no
video, instead of rendering and presenting 60 empty frames a second
- Chapter segments get clamped played/buffered fractions and are
equatable, so a time update re-renders only the chapter under the
playhead instead of every segment
- The mini player pauses its scrolling titles while the expanded player
covers it (iOS/tvOS)
- Performance logging no longer flags the first sample after a
foreground/background transition as high CPU
With the expanded player open in audio-only mode on an iPhone 12 mini,
app CPU dropped from ~30% to ~12% and wakeups from ~128/s to ~37/s.
Performance Logging (Developer settings) logs a resource sample every 5s
in the foreground and background: CPU by area and thread, wakeups, GPU,
memory, disk, activity counters as rates (mpv property updates, player
time publishes, renders, saves, network, images, CloudKit events, log
entries, main run-loop wakeups), SwiftUI body evaluations of the player
views, and app/player/battery context. Each foreground/background
transition logs a summary of the period. MetricKit metrics and
diagnostics (CPU exceptions, hangs) are logged whenever logging is on.
Background diagnostics (iOS) log lifecycle, audio session and power
events with an app/player/render snapshot and a heartbeat that detects
suspension gaps and main-thread stalls. Logs are persisted per session
in Caches/Logs and the previous session is included in exports, so logs
survive the app being swiped away.
Every mpv time-pos tick updated PlayerState.currentTime and bufferedTime,
re-rendering the invisible player controls, progress bar and chapter
segments several times per second while the app played in the
background, which drained the battery during long audio-only sessions.
- PlayerState keeps currentTime/bufferedTime current for readers but
stops notifying observers while publishesTimeUpdates is off;
PlayerService turns it off on entering the background and back on
(with one catch-up notification) before returning to the foreground
- MarqueeText pauses its animation timeline outside the active scene
- Replace the 100 ms polling loops in RemoteControlCoordinator and
ToastManager (iOS/tvOS) with observation-driven waits
Main-thread samples during 30 s of background audio-only playback on an
iPhone 12 mini went from 1289 to 248.