mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-11 02:24:13 +00:00
basesink: Don't nest prepare/render calls
When the first buffer arrives, we endup calling: ->prepare() ->prepare() ->preroll() ->render() 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: ->prepare() ->preroll() ->prepare() ->render() https://bugzilla.gnome.org/show_bug.cgi?id=772468
This commit is contained in:
parent
c53b2e3740
commit
5ca63b7f04
1 changed files with 11 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
preroll_failed:
|
||||
{
|
||||
GST_DEBUG_OBJECT (basesink, "preroll failed: %s", gst_flow_get_name (ret));
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
/* with STREAM_LOCK
|
||||
|
|
Loading…
Reference in a new issue