rtpav1depay: Don't unnecessary map RTP payload a second time

`RTPBuffer` already has it mapped internally and can give direct access
to it as byte slice.
This commit is contained in:
Sebastian Dröge 2022-09-12 18:08:33 +03:00
parent 7edc9e656f
commit cc0ef5290f

View file

@ -164,14 +164,7 @@ impl RTPBaseDepayloadImpl for RTPAv1Depay {
rtp.buffer().size(),
);
let payload = rtp
.payload_buffer()
.map_err(err_opt!(element, payload_buf))
.ok()?;
let payload_map = payload
.map_readable()
.map_err(err_opt!(element, payload_map))
.ok()?;
let payload = rtp.payload().map_err(err_opt!(element, payload_buf)).ok()?;
let mut state = self.state.lock().unwrap();
@ -182,7 +175,7 @@ impl RTPBaseDepayloadImpl for RTPAv1Depay {
// number of bytes that can be used in the next outgoing buffer
let mut bytes_ready = 0;
let mut reader = Cursor::new(payload_map.as_ref());
let mut reader = Cursor::new(payload);
let mut ready_obus = Buffer::new();
let aggr_header = {