webrtc: Reset received_caps when releasing pad

This is to work around a race where the pad is accessed in the
webrtc main thread while being released.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2104>
This commit is contained in:
Olivier Crête 2021-03-23 19:51:00 -04:00
parent b6114a7fed
commit 3be72a6c86

View file

@ -6268,6 +6268,7 @@ gst_webrtc_bin_release_pad (GstElement * element, GstPad * pad)
if (webrtc_pad->trans)
gst_object_unref (webrtc_pad->trans);
webrtc_pad->trans = NULL;
gst_caps_replace (&webrtc_pad->received_caps, NULL);
PC_UNLOCK (webrtc);
_remove_pad (webrtc, webrtc_pad);