mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2025-09-01 17:23:48 +00:00
rtprecv: Drop packets for which we have no clock-rate instead of panicking
Panicking if some spurious packet with an unknown payload type is received is not good behaviour. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2364>
This commit is contained in:
parent
72677a6825
commit
ae2e823340
1 changed files with 10 additions and 4 deletions
|
@ -712,10 +712,16 @@ impl RtpRecv {
|
|||
let mut sync_context = self.sync_context.lock().unwrap();
|
||||
let sync_context = sync_context.as_mut().unwrap();
|
||||
if !sync_context.has_clock_rate(rtp.ssrc()) {
|
||||
let clock_rate = session_inner
|
||||
.session
|
||||
.clock_rate_from_pt(rtp.payload_type())
|
||||
.unwrap();
|
||||
let Some(clock_rate) = session_inner.session.clock_rate_from_pt(rtp.payload_type())
|
||||
else {
|
||||
gst::warning!(
|
||||
CAT,
|
||||
imp = self,
|
||||
"Have no clock-rate for payload type {}",
|
||||
rtp.payload_type()
|
||||
);
|
||||
return Ok(RecvRtpBuffer::Drop);
|
||||
};
|
||||
sync_context.set_clock_rate(rtp.ssrc(), clock_rate);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue