ges: launcher: Commit timeline before setting state

Ensuring that all operations related to commit are properly performed

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5859>
This commit is contained in:
Thibault Saunier 2023-10-23 11:23:14 -03:00 committed by GStreamer Marge Bot
parent fae6fbaa6b
commit bf420a3a20

View file

@ -903,10 +903,12 @@ _project_loaded_cb (GESProject * project, GESTimeline * timeline,
g_free (project_uri);
if (!self->priv->seenerrors && opts->needs_set_state &&
gst_element_set_state (GST_ELEMENT (self->priv->pipeline),
GST_STATE_PLAYING) == GST_STATE_CHANGE_FAILURE) {
g_error ("Failed to start the pipeline\n");
if (!self->priv->seenerrors && opts->needs_set_state) {
ges_timeline_commit (self->priv->timeline);
if (gst_element_set_state (GST_ELEMENT (self->priv->pipeline),
GST_STATE_PLAYING) == GST_STATE_CHANGE_FAILURE) {
g_error ("Failed to start the pipeline\n");
}
}
}