2 Commits

Author SHA1 Message Date
907a734be3 Remove Cache prefix from cache duration display
All checks were successful
Build and Release / build-and-release (push) Successful in 55s
Display cache duration as "1.5s" instead of "Cache:1.5s" in
bottom status bar for cleaner presentation alongside other
technical metrics.
2025-12-09 12:23:04 +01:00
135700ce02 Update cache metric refresh rate to match other metadata
All checks were successful
Build and Release / build-and-release (push) Successful in 54s
Move cache duration update from update_properties (~10Hz) to
update_metadata (~0.5Hz) to match the refresh rate of codec,
bitrate, and sample rate. All bottom status bar metrics now
update at the same frequency.
2025-12-09 12:06:59 +01:00
3 changed files with 9 additions and 9 deletions

View File

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

View File

@@ -249,13 +249,6 @@ impl Player {
self.is_idle = idle;
}
}
// Update cache duration (how many seconds are buffered ahead)
if let Some(val) = self.get_property("demuxer-cache-duration") {
self.cache_duration = val.as_f64();
} else {
self.cache_duration = None;
}
}
pub fn update_metadata(&mut self) {
@@ -313,6 +306,13 @@ impl Player {
if let Some(val) = self.get_property("audio-params/samplerate") {
self.sample_rate = val.as_i64();
}
// Update cache duration (how many seconds are buffered ahead)
if let Some(val) = self.get_property("demuxer-cache-duration") {
self.cache_duration = val.as_f64();
} else {
self.cache_duration = None;
}
}
pub fn get_position(&self) -> Option<f64> {

View File

@@ -536,7 +536,7 @@ fn render_status_bar(frame: &mut Frame, state: &AppState, player: &Player, area:
if let Some(cache_dur) = player.cache_duration {
if cache_dur > 0.0 {
right_parts.push(format!("Cache:{:.1}s", cache_dur));
right_parts.push(format!("{:.1}s", cache_dur));
}
}