GESTimeline: set track state to NULL before removing from timeline

This commit is contained in:
Brandon Lewis 2010-10-22 15:58:22 +01:00 committed by Edward Hervey
parent f521d31b40
commit abce2912b8

View file

@ -774,11 +774,19 @@ ges_timeline_remove_track (GESTimeline * timeline, GESTrack * track)
g_signal_emit (timeline, ges_timeline_signals[TRACK_REMOVED], 0, track); g_signal_emit (timeline, ges_timeline_signals[TRACK_REMOVED], 0, track);
/* remove track from our bin */ /* remove track from our bin */
gst_object_ref (track);
if (G_UNLIKELY (!gst_bin_remove (GST_BIN (timeline), GST_ELEMENT (track)))) { if (G_UNLIKELY (!gst_bin_remove (GST_BIN (timeline), GST_ELEMENT (track)))) {
GST_WARNING ("Couldn't remove track to ourself (GST)"); GST_WARNING ("Couldn't remove track to ourself (GST)");
gst_object_unref (track);
return FALSE; return FALSE;
} }
/* set track state to NULL */
gst_element_set_state (GST_ELEMENT (track), GST_STATE_NULL);
gst_object_unref (track);
g_free (priv); g_free (priv);
return TRUE; return TRUE;