From c15137c2867a656e65ddbe4095ab9ca201f1e559 Mon Sep 17 00:00:00 2001 From: Ramyak Mehra Date: Sun, 13 Oct 2024 17:24:57 +0530 Subject: [PATCH] feat: add marker bit when packetizing opus. incase of silence opus rtp payload sets the marker bit after a talking spurt. usually the data in silence pacekts are empty, just use 1-2 bytes for header. fixes #125 --- src/packet/opus.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/packet/opus.rs b/src/packet/opus.rs index 365da501..0d9abfdd 100644 --- a/src/packet/opus.rs +++ b/src/packet/opus.rs @@ -23,8 +23,8 @@ impl Packetizer for OpusPacketizer { } fn is_marker(&mut self, data: &[u8], previous: Option<&[u8]>, last: bool) -> bool { - // TODO: dtx - false + // silence packets are usually empty with 1-2 bytes header + data.len() < 2 } }