aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2024-01-27 01:23:07 +0100
committermetamuffin <metamuffin@disroot.org>2024-01-27 01:23:07 +0100
commit2affa0fc842013b7ed1fd86cb8bd68f71fa6555c (patch)
tree350f1ea11f33a8f9ec4e4112449f359b3a8a1f65
parent7cc21df6a80881de08e008c3f79b232bd3591973 (diff)
downloadjellything-2affa0fc842013b7ed1fd86cb8bd68f71fa6555c.tar
jellything-2affa0fc842013b7ed1fd86cb8bd68f71fa6555c.tar.bz2
jellything-2affa0fc842013b7ed1fd86cb8bd68f71fa6555c.tar.zst
write shorter unknown size elements
-rw-r--r--matroska/src/write.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/matroska/src/write.rs b/matroska/src/write.rs
index aaf11d9..7eb13f1 100644
--- a/matroska/src/write.rs
+++ b/matroska/src/write.rs
@@ -240,15 +240,14 @@ impl WriteValue for EbmlSize {
fn write_to(&self, w: &mut impl Write) -> Result<()> {
match self {
EbmlSize::Exact(s) => write_vint(w, *s as u64)?,
- EbmlSize::Unknown => w.write_all(&(u64::MAX >> 7).to_be_bytes())?,
+ EbmlSize::Unknown => w.write_all(&[0xff])?,
}
Ok(())
}
-
fn size(&self) -> usize {
match self {
EbmlSize::Exact(s) => vint_length(*s as u64),
- EbmlSize::Unknown => 8,
+ EbmlSize::Unknown => 1,
}
}
}