From 727be96686a2c6c5747b26be15933e11c9cab9c6 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Sun, 28 Jan 2024 17:55:11 +0100 Subject: clean up some code + subrip support? --- common/src/impl.rs | 11 ++++++++--- common/src/lib.rs | 6 ++++-- 2 files changed, 12 insertions(+), 5 deletions(-) (limited to 'common/src') diff --git a/common/src/impl.rs b/common/src/impl.rs index 009b7c7..25cc47d 100644 --- a/common/src/impl.rs +++ b/common/src/impl.rs @@ -27,14 +27,19 @@ impl AssetRole { impl std::fmt::Display for SourceTrack { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { let kspec = match &self.kind { - SourceTrackKind::Video { width, height, fps } => { - format!("Video: {width}x{height} {fps}fps ") + SourceTrackKind::Video { + width, height, fps, .. + } => { + format!("Video: {width}x{height} {}fps ", fps.unwrap_or(0.)) } SourceTrackKind::Audio { channels, sample_rate, bit_depth, - } => format!("Audio: {channels}ch {sample_rate}Hz {bit_depth}bits "), + } => format!( + "Audio: {channels}ch {sample_rate}Hz {}bits ", + bit_depth.unwrap_or(0) + ), SourceTrackKind::Subtitles => "Subtitles: ".to_string(), }; f.write_fmt(format_args!( diff --git a/common/src/lib.rs b/common/src/lib.rs index 56d0d2e..8878edc 100644 --- a/common/src/lib.rs +++ b/common/src/lib.rs @@ -224,12 +224,14 @@ pub enum SourceTrackKind { Video { width: u64, height: u64, - fps: f64, + display_width: Option, + display_height: Option, + fps: Option, }, Audio { channels: usize, sample_rate: f64, - bit_depth: usize, + bit_depth: Option, }, Subtitles, } -- cgit v1.2.3-70-g09d2