Add metadata display and optimize CPU usage
All checks were successful
Build and Release / build-and-release (push) Successful in 58s

Metadata features:
- Display artist, album, title in bottom status bar (left-aligned)
- Display bitrate, codec, sample rate in bottom status bar (right-aligned)
- Fetch metadata from MPV using metadata/by-key properties
- Support both lowercase and uppercase metadata tags

Performance optimizations:
- Split property updates: fast updates (position/duration) vs slow (metadata)
- Update metadata only every 2 seconds instead of every 100ms
- Skip MPV property updates entirely when stopped
- Conditional UI redraws - only when state actually changes
- Variable poll rate: 200ms when stopped, 100ms when playing
- Position update throttling (0.5s minimum change)
- Reduces CPU usage from constant 10 FPS to ~0.1 FPS when idle
This commit is contained in:
2025-12-06 23:07:33 +01:00
parent ae80e9a5db
commit 0cef231cd3
4 changed files with 208 additions and 25 deletions

View File

@@ -1,6 +1,6 @@
[package]
name = "cm-player"
version = "0.1.9"
version = "0.1.10"
edition = "2021"
[dependencies]