Skip to content

Commit

Permalink
Up max blank padding size to 240
Browse files Browse the repository at this point in the history
Modulus 16 for SRTP.

Close #266
  • Loading branch information
algesten committed Oct 16, 2023
1 parent be283d5 commit 2cc19f2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/packet/pacer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use std::collections::HashMap;
use std::fmt;
use std::time::{Duration, Instant};

use crate::rtp_::MAX_BLANK_PADDING_PAYLOAD_SIZE;
use crate::rtp_::{Bitrate, DataSize, Mid};
use crate::util::already_happened;
use crate::util::not_happening;
Expand All @@ -11,7 +12,7 @@ use super::MediaKind;

const MAX_BITRATE: Bitrate = Bitrate::gbps(10);
const MAX_DEBT_IN_TIME: Duration = Duration::from_millis(500);
const MAX_PADDING_PACKET_SIZE: DataSize = DataSize::bytes(224);
const MAX_PADDING_PACKET_SIZE: DataSize = DataSize::bytes(MAX_BLANK_PADDING_PAYLOAD_SIZE as u64);
const PADDING_BURST_INTERVAL: Duration = Duration::from_millis(5);
const PACING: Duration = Duration::from_millis(40);

Expand Down
2 changes: 1 addition & 1 deletion src/rtp/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ mod bandwidth;
pub use bandwidth::{Bitrate, DataSize};

// Max in the RFC 3550 is 255 bytes, we limit it to be modulus 16 for SRTP and to match libWebRTC
pub const MAX_BLANK_PADDING_PAYLOAD_SIZE: usize = 224;
pub const MAX_BLANK_PADDING_PAYLOAD_SIZE: usize = 240;

/// Errors that can arise in RTP.
#[derive(Debug, Error)]
Expand Down

0 comments on commit 2cc19f2

Please sign in to comment.