track: Do not commit ourselves automatically when changing state from wrong thread

The user is responsible to commit the timeline from the right thread
in that case and in the case of gesdemux, the loaded timeline is filling
gaps automatically when the project is set loaded.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/166>
This commit is contained in:
Thibault Saunier 2020-04-24 16:46:50 -04:00
parent 4383df86c4
commit a71b4984f6

View file

@ -434,7 +434,10 @@ dispose_trackelements_foreach (GESTrackElement * trackelement, GESTrack * track)
static GstStateChangeReturn
ges_track_change_state (GstElement * element, GstStateChange transition)
{
if (transition == GST_STATE_CHANGE_READY_TO_PAUSED)
GESTrack *track = GES_TRACK (element);
if (transition == GST_STATE_CHANGE_READY_TO_PAUSED &&
track->priv->valid_thread == g_thread_self ())
track_resort_and_fill_gaps (GES_TRACK (element));
return GST_ELEMENT_CLASS (ges_track_parent_class)->change_state (element,