File tree Expand file tree Collapse file tree 3 files changed +3
-5
lines changed Expand file tree Collapse file tree 3 files changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -60,8 +60,8 @@ impl Stream {
6060
6161 let n = self . buffer . read ( buf, None ) . await ?;
6262 let mut b = & buf[ ..n] ;
63-
6463 let pkt = rtp:: packet:: Packet :: unmarshal ( & mut b) ?;
64+
6565 Ok ( pkt)
6666 }
6767
Original file line number Diff line number Diff line change @@ -956,8 +956,7 @@ impl PeerConnectionInternal {
956956 rsid_extension_id as u8 ,
957957 ) ?;
958958
959- let mut packet_buf = & buf. as_mut_slice ( ) [ ..self . setting_engine . get_receive_mtu ( ) ] ;
960- let packet = rtp:: packet:: Packet :: unmarshal ( & mut packet_buf) . unwrap ( ) ;
959+ let packet = rtp:: packet:: Packet :: unmarshal ( & mut buf. as_slice ( ) ) . unwrap ( ) ;
961960
962961 // TODO: Can we have attributes on the first packets?
963962 buffered_packets. push_back ( ( packet, Attributes :: new ( ) ) ) ;
Original file line number Diff line number Diff line change @@ -266,9 +266,8 @@ impl RTCPReader for SrtpWriterFuture {
266266 a : & Attributes ,
267267 ) -> IResult < ( Vec < Box < dyn rtcp:: packet:: Packet + Send + Sync > > , Attributes ) > {
268268 let read = self . read ( buf) . await ?;
269- let mut b = & buf[ ..read] ;
269+ let pkt = rtcp :: packet :: unmarshal ( & mut & buf[ ..read] ) ? ;
270270
271- let pkt = rtcp:: packet:: unmarshal ( & mut b) ?;
272271 Ok ( ( pkt, a. clone ( ) ) )
273272 }
274273}
You can’t perform that action at this time.
0 commit comments