From 36ead9e4915a35d803a5cbfeb89d828fefc13386 Mon Sep 17 00:00:00 2001 From: alexlapa <36732824+alexlapa@users.noreply.github.com> Date: Tue, 22 Oct 2024 15:23:10 +0300 Subject: [PATCH] Correctly handle per m-line Absolute Send Time --- CHANGELOG.md | 1 + src/streams/send.rs | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index da8d5c43..7c42c32e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ * Fix RTX stops working after packet loss spike #566 * Configure RTX ratio cap via `StreamTx::set_rtx_cache` #570 * Correctly handle per m-line TWCC #573 + * Correctly handle per m-line Absolute Send Time #575 # 0.6.1 * Force openssl to be >=0.10.66 #545 diff --git a/src/streams/send.rs b/src/streams/send.rs index a84d5416..429f4092 100644 --- a/src/streams/send.rs +++ b/src/streams/send.rs @@ -14,8 +14,8 @@ use crate::media::MediaKind; use crate::packet::QueuePriority; use crate::packet::QueueSnapshot; use crate::packet::QueueState; -use crate::rtp_::Bitrate; use crate::rtp_::{extend_u16, Descriptions, ReportList, Rtcp}; +use crate::rtp_::{Bitrate, Extension}; use crate::rtp_::{ExtensionMap, ReceptionReport, RtpHeader}; use crate::rtp_::{ExtensionValues, Frequency, MediaTime, Mid, NackEntry}; use crate::rtp_::{Pt, Rid, RtcpFb, SenderInfo, SenderReport, Ssrc}; @@ -465,7 +465,11 @@ impl StreamTx { // These need to match `Extension::is_supported()` so we are sending what we are // declaring we support. - header.ext_vals.abs_send_time = Some(now); + + // Absolute Send Time might not be enabled for this m-line. + if exts.id_of(Extension::AbsoluteSendTime).is_some() { + header.ext_vals.abs_send_time = Some(now); + } // TWCC might not be enabled for this m-line. if let Some(twcc) = twcc {