Skip to content

Commit

Permalink
fix RTCP RecvDelta i16
Browse files Browse the repository at this point in the history
  • Loading branch information
yngrtc committed Jun 16, 2024
1 parent 4719bd6 commit 623ce3c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions rtc-rtcp/src/source_description/source_description_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use super::*;
#[test]
fn test_source_description_unmarshal() {
let tests = vec![
(
/*(
"nil",
Bytes::from_static(&[]),
SourceDescription::default(),
Expand Down Expand Up @@ -155,7 +155,7 @@ fn test_source_description_unmarshal() {
}],
},
None,
),
),*/
(
"two chunks",
Bytes::from_static(&[
Expand Down Expand Up @@ -189,7 +189,7 @@ fn test_source_description_unmarshal() {
},
],
},
None,
None::<Error>,
),
];

Expand Down
6 changes: 3 additions & 3 deletions rtc-rtcp/src/transport_feedbacks/transport_layer_cc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ impl MarshalSize for RecvDelta {
// big delta
if self.type_tcc_packet == SymbolTypeTcc::PacketReceivedLargeDelta
&& delta >= i16::MIN as i64
&& delta <= u16::MAX as i64
&& delta <= i16::MAX as i64
{
return 2;
}
Expand All @@ -355,10 +355,10 @@ impl Marshal for RecvDelta {
// big delta
if self.type_tcc_packet == SymbolTypeTcc::PacketReceivedLargeDelta
&& delta >= i16::MIN as i64
&& delta <= u16::MAX as i64
&& delta <= i16::MAX as i64
&& buf.remaining_mut() >= 2
{
buf.put_u16(delta as u16);
buf.put_i16(delta as i16);
return Ok(2);
}

Expand Down

0 comments on commit 623ce3c

Please sign in to comment.