Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

peer_connection: Fix packet size for buffered simulcast packet #587

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions webrtc/src/peer_connection/peer_connection_internal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -980,21 +980,22 @@ impl PeerConnectionInternal {
})
.await;

let mut buf = vec![0u8; self.setting_engine.get_receive_mtu()];
// Packets that we read as part of simulcast probing that we need to make available
// if we do find a track later.
let mut buffered_packets: VecDeque<(rtp::packet::Packet, Attributes)> = VecDeque::default();

let mut buf = vec![0u8; self.setting_engine.get_receive_mtu()];
let n = rtp_stream.read(&mut buf).await?;
let mut b = &buf[..n];

let (mut mid, mut rid, mut rsid, payload_type) = handle_unknown_rtp_packet(
&buf[..n],
b,
mid_extension_id as u8,
sid_extension_id as u8,
rsid_extension_id as u8,
)?;

let packet = rtp::packet::Packet::unmarshal(&mut buf.as_slice()).unwrap();
let packet = rtp::packet::Packet::unmarshal(&mut b).unwrap();

// TODO: Can we have attributes on the first packets?
buffered_packets.push_back((packet, Attributes::new()));
Expand Down
Loading