diff options
author | metamuffin <metamuffin@disroot.org> | 2023-01-26 09:10:23 +0100 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2023-01-26 09:10:23 +0100 |
commit | 42e1c3003c671e9a08d180b84bfa8e00ba858660 (patch) | |
tree | f14d0addd16ce6cf8c6a1c1292b9b5db8ddd0b09 /remuxer/src | |
parent | d48c939eb65b1b40d54644ee35e66d079789e54f (diff) | |
download | jellything-42e1c3003c671e9a08d180b84bfa8e00ba858660.tar jellything-42e1c3003c671e9a08d180b84bfa8e00ba858660.tar.bz2 jellything-42e1c3003c671e9a08d180b84bfa8e00ba858660.tar.zst |
cleanup
Diffstat (limited to 'remuxer/src')
-rw-r--r-- | remuxer/src/lib.rs | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/remuxer/src/lib.rs b/remuxer/src/lib.rs index d91bfe5..91c913a 100644 --- a/remuxer/src/lib.rs +++ b/remuxer/src/lib.rs @@ -186,17 +186,20 @@ impl RemuxerContext { "writing cluster {cluster_index} with {} blocks", cluster.len() ); - for (block_index, block) in cluster { + for (block_index, iblock) in cluster { let kn = &mut ks[block_index]; - let mut next = kn.peek.replace(kn.stream.next()?).unwrap(); //.ok_or(anyhow!("eof?")); + let mut block = kn + .peek + .replace(kn.stream.next()?) + .expect("source file too short"); - assert_eq!(block.size, next.block.data.len(), "the seek index is wrong"); - assert_eq!(block.pts, next.pts(), "the seek index is wrong"); + assert_eq!(iblock.size, block.block.data.len(), "seek index is wrong"); + assert_eq!(iblock.pts, block.pts(), "seek index is wrong"); - let pts = next.pts(); - next.block.track = kn.mapped; - next.block.timestamp_off = 0; - let buf = next.block.dump(); + let pts = block.pts(); + block.block.track = kn.mapped; + block.block.timestamp_off = 0; + let buf = block.block.dump(); output.write_tag(&MatroskaTag::Cluster(Master::Collected(vec![ MatroskaTag::Timestamp(pts), MatroskaTag::SimpleBlock(buf), |