diff options
author | metamuffin <metamuffin@disroot.org> | 2024-01-28 03:21:03 +0100 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2024-01-28 03:21:03 +0100 |
commit | ce9eb140ab9243d1c87ace4727a82b7fa50f964b (patch) | |
tree | b64da94ba58f72a2371cdd8644dc48a178b7d260 /transcoder/src/subtitles.rs | |
parent | b514ec8cea2c2143e0bd7a0eb377c96a6f091d0d (diff) | |
download | jellything-ce9eb140ab9243d1c87ace4727a82b7fa50f964b.tar jellything-ce9eb140ab9243d1c87ace4727a82b7fa50f964b.tar.bz2 jellything-ce9eb140ab9243d1c87ace4727a82b7fa50f964b.tar.zst |
fix yet another fundamental issue in the ebml reader and seekindex.
Diffstat (limited to 'transcoder/src/subtitles.rs')
-rw-r--r-- | transcoder/src/subtitles.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/transcoder/src/subtitles.rs b/transcoder/src/subtitles.rs index 1fea3cf..84db5a9 100644 --- a/transcoder/src/subtitles.rs +++ b/transcoder/src/subtitles.rs @@ -39,6 +39,18 @@ pub fn parse_webvtt_blocks(blocks: Vec<(u64, u64, Vec<u8>)>) -> anyhow::Result<V } Ok(out) } +pub fn parse_pgs_blocks(blocks: Vec<(u64, u64, Vec<u8>)>) -> anyhow::Result<Vec<SubtitleCue>> { + let mut out = Vec::new(); + for (pts, dur, block) in blocks { + let _content = String::from_utf8_lossy(&block).trim().to_string(); + out.push(SubtitleCue { + content: "PGS stub".to_string(), + start: pts as f64 / 1000., + end: (pts + dur) as f64 / 1000., + }); + } + Ok(out) +} pub fn parse_ass_blocks( _codec_private: Vec<u8>, |