mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 04:01:08 +00:00
GESTimeline: Freeze state of Tracks when doing an async state change
This commit is contained in:
parent
9dd1d7f1ba
commit
8193fe5b4c
1 changed files with 15 additions and 0 deletions
|
@ -271,9 +271,16 @@ static void
|
|||
do_async_start (GESTimeline * timeline)
|
||||
{
|
||||
GstMessage *message;
|
||||
GList *tmp;
|
||||
|
||||
timeline->async_pending = TRUE;
|
||||
|
||||
/* Freeze state of tracks */
|
||||
for (tmp = timeline->tracks; tmp; tmp = tmp->next) {
|
||||
TrackPrivate *priv = (TrackPrivate *) tmp->data;
|
||||
gst_element_set_locked_state ((GstElement *) priv->track, TRUE);
|
||||
}
|
||||
|
||||
message = gst_message_new_async_start (GST_OBJECT_CAST (timeline), FALSE);
|
||||
parent_class->handle_message (GST_BIN_CAST (timeline), message);
|
||||
}
|
||||
|
@ -284,6 +291,14 @@ do_async_done (GESTimeline * timeline)
|
|||
GstMessage *message;
|
||||
|
||||
if (timeline->async_pending) {
|
||||
GList *tmp;
|
||||
/* Unfreeze state of tracks */
|
||||
for (tmp = timeline->tracks; tmp; tmp = tmp->next) {
|
||||
TrackPrivate *priv = (TrackPrivate *) tmp->data;
|
||||
gst_element_set_locked_state ((GstElement *) priv->track, FALSE);
|
||||
gst_element_sync_state_with_parent ((GstElement *) priv->track);
|
||||
}
|
||||
|
||||
GST_DEBUG_OBJECT (timeline, "Emitting async-done");
|
||||
message = gst_message_new_async_done (GST_OBJECT_CAST (timeline));
|
||||
parent_class->handle_message (GST_BIN_CAST (timeline), message);
|
||||
|
|
Loading…
Reference in a new issue