diff options
author | metamuffin <metamuffin@disroot.org> | 2024-01-28 17:55:11 +0100 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2024-01-28 17:55:11 +0100 |
commit | 727be96686a2c6c5747b26be15933e11c9cab9c6 (patch) | |
tree | 817accf6c4965e814cc8736fdbd17b423fae0669 /remuxer/src/import/mod.rs | |
parent | 5b587f2914908daa804bb643ac216001290077ab (diff) | |
download | jellything-727be96686a2c6c5747b26be15933e11c9cab9c6.tar jellything-727be96686a2c6c5747b26be15933e11c9cab9c6.tar.bz2 jellything-727be96686a2c6c5747b26be15933e11c9cab9c6.tar.zst |
clean up some code + subrip support?
Diffstat (limited to 'remuxer/src/import/mod.rs')
-rw-r--r-- | remuxer/src/import/mod.rs | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/remuxer/src/import/mod.rs b/remuxer/src/import/mod.rs index d6fa2d0..e26b575 100644 --- a/remuxer/src/import/mod.rs +++ b/remuxer/src/import/mod.rs @@ -263,6 +263,8 @@ fn import_read_segment(segment: &mut Unflatten) -> Result<MatroskaMetadata> { mut channels, mut width, mut height, + mut display_width, + mut display_height, mut name, mut fps, mut bit_depth, @@ -270,7 +272,7 @@ fn import_read_segment(segment: &mut Unflatten) -> Result<MatroskaMetadata> { mut default_duration, ) = ( None, None, None, None, None, None, None, None, None, None, None, - None, None, + None, None, None, None, ); while let Some(Ok(Unflat { children, item, .. })) = children.n() { match item { @@ -302,6 +304,12 @@ fn import_read_segment(segment: &mut Unflatten) -> Result<MatroskaMetadata> { match item { MatroskaTag::PixelWidth(v) => width = Some(v), MatroskaTag::PixelHeight(v) => height = Some(v), + MatroskaTag::DisplayWidth(v) => { + display_width = Some(v) + } + MatroskaTag::DisplayHeight(v) => { + display_height = Some(v) + } MatroskaTag::FrameRate(v) => fps = Some(v), _ => (), } @@ -313,13 +321,15 @@ fn import_read_segment(segment: &mut Unflatten) -> Result<MatroskaMetadata> { let track_index = index.unwrap(); let kind = match kind.ok_or(anyhow!("track type required"))? { 1 => SourceTrackKind::Video { - fps: fps.unwrap_or(0.0), // TODO + fps, width: width.unwrap(), height: height.unwrap(), + display_width, + display_height, }, 2 => SourceTrackKind::Audio { - bit_depth: bit_depth.unwrap_or(0) as usize, // TODO - channels: channels.unwrap_or(1), // TODO + bit_depth: bit_depth.map(|x| x as usize), + channels: channels.unwrap_or(1), // TODO sample_rate: sample_rate.unwrap_or(41_100.0), // TODO }, 17 => SourceTrackKind::Subtitles, |