track: add gaps when going from READY to PAUSED.
authorMathieu Duponchelle <mathieu.duponchelle@opencreed.com>
Wed, 30 Sep 2015 12:50:46 +0000 (14:50 +0200)
committerThibault Saunier <tsaunier@gnome.org>
Wed, 30 Sep 2015 12:50:46 +0000 (14:50 +0200)
Summary:
The backend commits itself automatically in these cases, so track
needs to do so too.

Reviewers: thiblahute

Reviewed By: thiblahute

Differential Revision: https://phabricator.freedesktop.org/D94

ges/ges-track.c

index bbb35087a64b2a7023201aef2ac74ce3c8b880ab..581c770a38920dbd3c932bad82e737d4bf8b6d5f 100644 (file)
@@ -389,6 +389,18 @@ dispose_trackelements_foreach (GESTrackElement * trackelement, GESTrack * track)
   remove_object_internal (track, trackelement);
 }
 
+/* GstElement virtual methods */
+
+static GstStateChangeReturn
+ges_track_change_state (GstElement * element, GstStateChange transition)
+{
+  if (transition == GST_STATE_CHANGE_READY_TO_PAUSED)
+    track_resort_and_fill_gaps (GES_TRACK (element));
+
+  return GST_ELEMENT_CLASS (ges_track_parent_class)->change_state (element,
+      transition);
+}
+
 /* GObject virtual methods */
 static void
 ges_track_get_property (GObject * object, guint property_id,
@@ -554,6 +566,8 @@ ges_track_class_init (GESTrackClass * klass)
 
   g_type_class_add_private (klass, sizeof (GESTrackPrivate));
 
+  gstelement_class->change_state = GST_DEBUG_FUNCPTR (ges_track_change_state);
+
   object_class->get_property = ges_track_get_property;
   object_class->set_property = ges_track_set_property;
   object_class->dispose = ges_track_dispose;