From: commit-queue@webkit.org Date: Thu, 31 Jan 2019 14:24:05 +0000 (+0000) Subject: [GStreamer][WebRTC] Avoid returning FLUSHING when it is not the case in GStreamerMedi... X-Git-Url: http://git.webkit.org/?p=WebKit-https.git;a=commitdiff_plain;h=5659649751ccae71d431ae2f7d3c4430941d3ef8 [GStreamer][WebRTC] Avoid returning FLUSHING when it is not the case in GStreamerMediaStreamSource https://bugs.webkit.org/show_bug.cgi?id=194087 Basically GstFlowCombiner was mostly designed for element that have 1 sinkpad and several srcpad meaning that it makes sense that when any of the downstream pad is returning flushing, you should return FLUSHING upstream. But in our case we have several sinkpads and FLUSHING should be returned *only* if the internally linked srcpad is FLUSHING otherwise we might end up setting the upstream source element task to PAUSED (because downstream returned flushing) on a branch that was not flushing! Patch by Thibault Saunier on 2019-01-31 Reviewed by Philippe Normand. This is a theorical race we can't really cover with tests. * platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp: (WebCore::webkitMediaStreamSrcChain): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240782 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog index 8169133b..8485d7d 100644 --- a/Source/WebCore/ChangeLog +++ b/Source/WebCore/ChangeLog @@ -1,3 +1,22 @@ +2019-01-31 Thibault Saunier + + [GStreamer][WebRTC] Avoid returning FLUSHING when it is not the case in GStreamerMediaStreamSource + https://bugs.webkit.org/show_bug.cgi?id=194087 + + Basically GstFlowCombiner was mostly designed for element that have 1 sinkpad and several srcpad + meaning that it makes sense that when any of the downstream pad is returning flushing, you should + return FLUSHING upstream. But in our case we have several sinkpads and FLUSHING should be returned + *only* if the internally linked srcpad is FLUSHING otherwise we might end up setting the upstream + source element task to PAUSED (because downstream returned flushing) on a branch that was not + flushing! + + Reviewed by Philippe Normand. + + This is a theorical race we can't really cover with tests. + + * platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp: + (WebCore::webkitMediaStreamSrcChain): + 2019-01-31 Zalan Bujtas [LFC] Margin before/after/start/end initial value is 0 and not auto. diff --git a/Source/WebCore/platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp b/Source/WebCore/platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp index 927d986..c391c4c 100644 --- a/Source/WebCore/platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp +++ b/Source/WebCore/platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp @@ -368,11 +368,14 @@ typedef struct { static GstFlowReturn webkitMediaStreamSrcChain(GstPad* pad, GstObject* parent, GstBuffer* buffer) { - GstFlowReturn result; + GstFlowReturn result, chain_result; GRefPtr self = adoptGRef(WEBKIT_MEDIA_STREAM_SRC(gst_object_get_parent(parent))); - result = gst_flow_combiner_update_pad_flow(self.get()->flowCombiner, pad, - gst_proxy_pad_chain_default(pad, GST_OBJECT(self.get()), buffer)); + chain_result = gst_proxy_pad_chain_default(pad, GST_OBJECT(self.get()), buffer); + result = gst_flow_combiner_update_pad_flow(self.get()->flowCombiner, pad, chain_result); + + if (result == GST_FLOW_FLUSHING) + return chain_result; return result; }