small updates

This commit is contained in:
kozabrada123 2023-12-17 11:51:02 +01:00
parent ba4818dbad
commit 3875e2e7ee
1 changed files with 7 additions and 4 deletions

View File

@ -53,7 +53,7 @@ impl UdpHandle {
// Always the same // Always the same
version: 2, version: 2,
padding: 0, padding: 0,
extension: 1, extension: 0,
csrc_count: 0, csrc_count: 0,
csrc_list: Vec::new(), csrc_list: Vec::new(),
marker: 0, marker: 0,
@ -65,6 +65,8 @@ impl UdpHandle {
payload, payload,
}; };
debug!("VUDP: Constructed udp data: {:?}", rtp_data);
let mut buffer = Vec::new(); let mut buffer = Vec::new();
let buffer_size = payload_len + RTP_HEADER_SIZE as usize; let buffer_size = payload_len + RTP_HEADER_SIZE as usize;
@ -88,7 +90,8 @@ impl UdpHandle {
.await; .await;
} }
/// Encrypts an unencrypted rtp packet, returning an encrypted copy if its payload. /// Encrypts an unencrypted rtp packet, returning a copy of the packet's bytes with an
/// encrypted payload
pub async fn encrypt_rtp_packet_payload( pub async fn encrypt_rtp_packet_payload(
&self, &self,
packet: &discortp::rtp::MutableRtpPacket<'_>, packet: &discortp::rtp::MutableRtpPacket<'_>,
@ -263,8 +266,8 @@ impl UdpHandler {
for _i in 0..1_000 { for _i in 0..1_000 {
buf.push(0); buf.push(0);
} }
let msg = self.socket.recv(&mut buf).await; let result = self.socket.recv(&mut buf).await;
if let Ok(size) = msg { if let Ok(size) = result {
self.handle_message(&buf[0..size]).await; self.handle_message(&buf[0..size]).await;
continue; continue;
} }