Skip to content

Commit

Permalink
Update mod.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
yngrtc authored and yngrtc committed Jun 12, 2023
1 parent ab67071 commit a1c8844
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
5 changes: 1 addition & 4 deletions media/src/io/sample_builder/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -373,10 +373,7 @@ impl<T: Depacketizer> SampleBuilder<T> {
if self.prepared.empty() {
return None;
}
let result = std::mem::replace(
&mut self.prepared_samples[self.prepared.head as usize],
None,
);
let result = self.prepared_samples[self.prepared.head as usize].take();
self.prepared.head = self.prepared.head.wrapping_add(1);
result
}
Expand Down
8 changes: 4 additions & 4 deletions webrtc/src/peer_connection/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -911,7 +911,7 @@ impl RTCPeerConnection {
let remote_description: RTCSessionDescription;
if let Some(desc) = remote_desc {
remote_description = desc;
}else{
} else {
return Err(Error::ErrNoRemoteDescription);
}
if use_identity {
Expand All @@ -931,7 +931,7 @@ impl RTCPeerConnection {
.to_connection_role();
if connection_role == ConnectionRole::Unspecified {
connection_role = DEFAULT_DTLS_ROLE_ANSWER.to_connection_role();
if let Some(parsed) = remote_description.parsed {
if let Some(parsed) = remote_description.parsed {
if Self::is_lite_set(&parsed) && !self.internal.setting_engine.candidates.ice_lite {
connection_role = DTLSRole::Server.to_connection_role();
}
Expand Down Expand Up @@ -1306,13 +1306,13 @@ impl RTCPeerConnection {
self.current_local_description().await
}

pub fn is_lite_set(desc: &SessionDescription) -> bool{
pub fn is_lite_set(desc: &SessionDescription) -> bool {
for a in &desc.attributes {
if a.key.trim() == ATTR_KEY_ICELITE {
return true;
}
}
return false;
false
}

/// set_remote_description sets the SessionDescription of the remote peer
Expand Down

0 comments on commit a1c8844

Please sign in to comment.