small updates

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

View File

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