From 70c023626a43baa788e84e56824673b7b8368f08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Mon, 19 Mar 2012 10:56:53 +0000 Subject: [PATCH 1/2] ges-pitivi-formatter: add copyright/license headers https://bugzilla.gnome.org/show_bug.cgi?id=644943 --- ges/ges-pitivi-formatter.c | 19 +++++++++++++++++++ ges/ges-pitivi-formatter.h | 19 +++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/ges/ges-pitivi-formatter.c b/ges/ges-pitivi-formatter.c index 540fd10e50..f828eecb70 100644 --- a/ges/ges-pitivi-formatter.c +++ b/ges/ges-pitivi-formatter.c @@ -1,3 +1,22 @@ +/* GStreamer Editing Services Pitivi Formatter + * Copyright (C) 2011-2012 Mathieu Duponchelle + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + #include #include #include diff --git a/ges/ges-pitivi-formatter.h b/ges/ges-pitivi-formatter.h index 4dffafa352..80751aa4d4 100644 --- a/ges/ges-pitivi-formatter.h +++ b/ges/ges-pitivi-formatter.h @@ -1,3 +1,22 @@ +/* GStreamer Editing Services Pitivi Formatter + * Copyright (C) 2011-2012 Mathieu Duponchelle + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + #ifndef _GES_PITIVI_FORMATTER #define _GES_PITIVI_FORMATTER From 4148d605ad00854b43eb36db3db2078ab3645881 Mon Sep 17 00:00:00 2001 From: Volodymyr Rudyi Date: Wed, 28 Mar 2012 02:53:50 +0300 Subject: [PATCH 2/2] ges-track: Set gnlobject state to NULL before disposing it Work around a deadlock if setting state to NULL right before removing the gnlobject from the composition. https://bugzilla.gnome.org/show_bug.cgi?id=672751 --- ges/ges-track.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/ges/ges-track.c b/ges/ges-track.c index 8632471fd2..5701755e54 100644 --- a/ges/ges-track.c +++ b/ges/ges-track.c @@ -303,7 +303,7 @@ ges_track_init (GESTrack * self) * * Creates a new #GESTrack with the given @type and @caps. * - * The newly created track will steal a reference to the caps. If you wish to + * The newly created track will steal a reference to the caps. If you wish to * use those caps elsewhere, you will have to take an extra reference. * * Returns: A new #GESTrack. @@ -553,10 +553,19 @@ ges_track_remove_object (GESTrack * track, GESTrackObject * object) if ((gnlobject = ges_track_object_get_gnlobject (object))) { GST_DEBUG ("Removing GnlObject '%s' from composition '%s'", GST_ELEMENT_NAME (gnlobject), GST_ELEMENT_NAME (priv->composition)); + /* We can't just set state of gnlobject to GST_STATE_NULL, because it will + * result in deadlock. Adding a ref to the gnlobj so we finalize it after + * removing it from the composition */ + gst_object_ref (gnlobject); if (!gst_bin_remove (GST_BIN (priv->composition), gnlobject)) { GST_WARNING ("Failed to remove gnlobject from composition"); return FALSE; } + + gst_element_set_state (gnlobject, GST_STATE_NULL); + /* Wait for the state change to actually happen */ + gst_element_get_state (gnlobject, NULL, NULL, GST_CLOCK_TIME_NONE); + gst_object_unref (gnlobject); } g_signal_handlers_disconnect_by_func (object, sort_track_objects_cb, NULL);