Commit 5ca63b7f authored by Nicolas Dufresne's avatar Nicolas Dufresne

basesink: Don't nest prepare/render calls

When the first buffer arrives, we endup calling:


This will likely confuse any element using this method. With this patch,
we ensure the preroll take place before the first render prepare() is
called. This will result in:

parent c53b2e37
......@@ -3479,6 +3479,12 @@ gst_base_sink_chain_unlocked (GstBaseSink * basesink, GstPad * pad,
if (G_UNLIKELY (late))
goto dropped;
/* We are about to prepare the first frame, make sure we have prerolled
* already. This prevent nesting prepare/render calls. */
ret = gst_base_sink_do_preroll (basesink, obj);
if (G_UNLIKELY (ret != GST_FLOW_OK))
goto preroll_failed;
if (!is_list) {
if (bclass->prepare) {
ret = bclass->prepare (basesink, GST_BUFFER_CAST (obj));
......@@ -3639,6 +3645,11 @@ dropped:
goto done;
GST_DEBUG_OBJECT (basesink, "preroll failed: %s", gst_flow_get_name (ret));
return ret;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment