mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2025-09-02 09:43: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 mut sync_context = self.sync_context.lock().unwrap();
|
||||||
let sync_context = sync_context.as_mut().unwrap();
|
let sync_context = sync_context.as_mut().unwrap();
|
||||||
if !sync_context.has_clock_rate(rtp.ssrc()) {
|
if !sync_context.has_clock_rate(rtp.ssrc()) {
|
||||||
let clock_rate = session_inner
|
let Some(clock_rate) = session_inner.session.clock_rate_from_pt(rtp.payload_type())
|
||||||
.session
|
else {
|
||||||
.clock_rate_from_pt(rtp.payload_type())
|
gst::warning!(
|
||||||
.unwrap();
|
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);
|
sync_context.set_clock_rate(rtp.ssrc(), clock_rate);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue