rtp: basepay: Don't negotiate twice in the beginning

If srcpad caps are already set as part of sinkpad caps handling, unset
the reconfigure flag so negotiation does not happen yet another time on
the first buffer.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1693>
This commit is contained in:
Sebastian Dröge 2024-08-07 10:47:28 +03:00 committed by GStreamer Marge Bot
parent 31e836f4d6
commit c5163a73ee

View file

@ -230,11 +230,13 @@ impl RtpBasePay2 {
let state = self.state.borrow_mut(); let state = self.state.borrow_mut();
let Some(ref src_caps) = state.src_caps else { let Some(ref src_caps) = state.src_caps else {
gst::debug!(CAT, imp = self, "No src caps set yet, can't negotiate"); gst::debug!(CAT, imp = self, "No src caps set yet, can't negotiate");
self.src_pad.mark_reconfigure();
return; return;
}; };
let mut src_caps = src_caps.clone(); let mut src_caps = src_caps.clone();
drop(state); drop(state);
self.src_pad.check_reconfigure();
gst::debug!(CAT, imp = self, "Configured src caps: {src_caps:?}"); gst::debug!(CAT, imp = self, "Configured src caps: {src_caps:?}");
let peer_caps = self.src_pad.peer_query_caps(Some(&src_caps)); let peer_caps = self.src_pad.peer_query_caps(Some(&src_caps));