aboutsummaryrefslogtreecommitdiff
path: root/common/src
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2024-01-28 17:55:11 +0100
committermetamuffin <metamuffin@disroot.org>2024-01-28 17:55:11 +0100
commit727be96686a2c6c5747b26be15933e11c9cab9c6 (patch)
tree817accf6c4965e814cc8736fdbd17b423fae0669 /common/src
parent5b587f2914908daa804bb643ac216001290077ab (diff)
downloadjellything-727be96686a2c6c5747b26be15933e11c9cab9c6.tar
jellything-727be96686a2c6c5747b26be15933e11c9cab9c6.tar.bz2
jellything-727be96686a2c6c5747b26be15933e11c9cab9c6.tar.zst
clean up some code + subrip support?
Diffstat (limited to 'common/src')
-rw-r--r--common/src/impl.rs11
-rw-r--r--common/src/lib.rs6
2 files changed, 12 insertions, 5 deletions
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<u64>,
+ display_height: Option<u64>,
+ fps: Option<f64>,
},
Audio {
channels: usize,
sample_rate: f64,
- bit_depth: usize,
+ bit_depth: Option<usize>,
},
Subtitles,
}