timeline: stop connecting to track-element-added

This was used to connect to the track element's notify::start signal in
order to update the duration of the timeline (it is not clear why the
notify::duration signal was not also connected to for the same reason).
However, this is already covered by the timeline_tree_move method, which
is always called to update the start of a track element, even if it is not
part of a clip (and similarly for timeline_tree_trim, which is called
when the duration is set).
This commit is contained in:
Henry Wilkes 2020-03-26 09:21:42 +00:00
parent a93e873402
commit f7a1bdb289

View file

@ -1667,31 +1667,6 @@ update_stream_object (TrackPrivate * tr_priv)
return res; return res;
} }
static void
trackelement_start_changed_cb (GESTrackElement * child,
GParamSpec * arg G_GNUC_UNUSED, GESTimeline * timeline)
{
timeline_update_duration (timeline);
}
static void
track_element_added_cb (GESTrack * track, GESTrackElement * track_element,
GESTimeline * timeline)
{
/* Auto transition should be updated before we receive the signal */
g_signal_connect_after (GES_TRACK_ELEMENT (track_element), "notify::start",
G_CALLBACK (trackelement_start_changed_cb), timeline);
}
static void
track_element_removed_cb (GESTrack * track,
GESTrackElement * track_element, GESTimeline * timeline)
{
/* Disconnect all signal handlers */
g_signal_handlers_disconnect_by_func (track_element,
trackelement_start_changed_cb, timeline);
}
static GstPadProbeReturn static GstPadProbeReturn
_pad_probe_cb (GstPad * mixer_pad, GstPadProbeInfo * info, _pad_probe_cb (GstPad * mixer_pad, GstPadProbeInfo * info,
TrackPrivate * tr_priv) TrackPrivate * tr_priv)
@ -2205,12 +2180,6 @@ ges_timeline_add_track (GESTimeline * timeline, GESTrack * track)
/* ensure that each existing clip has the opportunity to create a /* ensure that each existing clip has the opportunity to create a
* track element for this track*/ * track element for this track*/
/* We connect to the object for the timeline editing mode management */
g_signal_connect (G_OBJECT (track), "track-element-added",
G_CALLBACK (track_element_added_cb), timeline);
g_signal_connect (G_OBJECT (track), "track-element-removed",
G_CALLBACK (track_element_removed_cb), timeline);
for (tmp = timeline->layers; tmp; tmp = tmp->next) { for (tmp = timeline->layers; tmp; tmp = tmp->next) {
GList *objects, *obj; GList *objects, *obj;
objects = ges_layer_get_clips (tmp->data); objects = ges_layer_get_clips (tmp->data);
@ -2283,12 +2252,6 @@ ges_timeline_remove_track (GESTimeline * timeline, GESTrack * track)
gst_element_remove_pad (GST_ELEMENT (timeline), tr_priv->ghostpad); gst_element_remove_pad (GST_ELEMENT (timeline), tr_priv->ghostpad);
} }
/* Remove pad-added/-removed handlers */
g_signal_handlers_disconnect_by_func (track, track_element_added_cb,
timeline);
g_signal_handlers_disconnect_by_func (track, track_element_removed_cb,
timeline);
/* Signal track removal to all layers/objects */ /* Signal track removal to all layers/objects */
g_signal_emit (timeline, ges_timeline_signals[TRACK_REMOVED], 0, track); g_signal_emit (timeline, ges_timeline_signals[TRACK_REMOVED], 0, track);