From 91f119e6b6d5f6dc43d24d0e12858bc8428357c9 Mon Sep 17 00:00:00 2001 From: Harry Date: Thu, 8 Oct 2026 14:32:43 +0200 Subject: [PATCH] refactor: drop unused current segment from Health --- crates/clipbin-obs/src/ffi.rs | 1 - crates/clipbin-obs/src/recorder.rs | 8 +++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/crates/clipbin-obs/src/ffi.rs b/crates/clipbin-obs/src/ffi.rs index ba4adb6..d2611ce 100644 --- a/crates/clipbin-obs/src/ffi.rs +++ b/crates/clipbin-obs/src/ffi.rs @@ -758,7 +758,6 @@ impl Pipeline { dropped_frames: sys::obs_output_get_frames_dropped(self.output).max(0) as u64, total_bytes: sys::obs_output_get_total_bytes(self.output), lagged_frames: sys::obs_get_lagged_frames() as u64, - current_segment: None, written_bytes: 0, disk_available_bytes: None, } diff --git a/crates/clipbin-obs/src/recorder.rs b/crates/clipbin-obs/src/recorder.rs index 18951fa..0f39d9a 100644 --- a/crates/clipbin-obs/src/recorder.rs +++ b/crates/clipbin-obs/src/recorder.rs @@ -225,11 +225,11 @@ impl Recording { if let Some(finished) = written.current.take() { written.finished_bytes += size(&finished); } - written.current = current.clone(); + written.current = current; } - health.written_bytes = written.finished_bytes + current.as_deref().map_or(0, size); + health.written_bytes = + written.finished_bytes + written.current.as_deref().map_or(0, size); } - health.current_segment = current; health } @@ -278,7 +278,6 @@ pub struct Health { pub dropped_frames: u64, pub total_bytes: u64, pub lagged_frames: u64, - pub current_segment: Option, /// Bytes on disk across all of this recording's segments. pub written_bytes: u64, /// Free space on the recording volume, if it could be read. @@ -457,7 +456,6 @@ mod tests { dropped_frames: 0, total_bytes: bytes, lagged_frames: 0, - current_segment: Some("segment-000000.mkv".into()), written_bytes: bytes, disk_available_bytes: Some(u64::MAX), }