diff options
Diffstat (limited to 'remuxer')
-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), |