aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSjoerd Simons <sjoerd.simons@collabora.co.uk>2011-03-14 17:37:43 +0800
committerSjoerd Simons <sjoerd.simons@collabora.co.uk>2011-03-14 19:08:17 +0800
commite026781c4d7974cc047a823512fb6cb8aa266f17 (patch)
tree6f8ed31a8c0244f5459e342f270f195cd8010169
parente8a99ac3fc77e2746078b688c208963df5ae19aa (diff)
downloadgsoc2013-empathy-e026781c4d7974cc047a823512fb6cb8aa266f17.tar
gsoc2013-empathy-e026781c4d7974cc047a823512fb6cb8aa266f17.tar.gz
gsoc2013-empathy-e026781c4d7974cc047a823512fb6cb8aa266f17.tar.bz2
gsoc2013-empathy-e026781c4d7974cc047a823512fb6cb8aa266f17.tar.lz
gsoc2013-empathy-e026781c4d7974cc047a823512fb6cb8aa266f17.tar.xz
gsoc2013-empathy-e026781c4d7974cc047a823512fb6cb8aa266f17.tar.zst
gsoc2013-empathy-e026781c4d7974cc047a823512fb6cb8aa266f17.zip
Ensure our bin doesn't change state before being in the hash table
-rw-r--r--src/empathy-audio-sink.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/empathy-audio-sink.c b/src/empathy-audio-sink.c
index 31fffff10..1120daec1 100644
--- a/src/empathy-audio-sink.c
+++ b/src/empathy-audio-sink.c
@@ -357,15 +357,23 @@ empathy_audio_sink_request_new_pad (GstElement *element,
if (!gst_element_add_pad (GST_ELEMENT (bin), subpad))
goto error;
+
+ /* Ensure that state changes only happen _after_ the element has been added
+ * to the hash table. But add it to the bin first so we can create our
+ * ghostpad (if we create the ghostpad before adding it to the bin it will
+ * get unlinked) */
+ gst_element_set_locked_state (GST_ELEMENT (bin), TRUE);
gst_bin_add (GST_BIN (self), bin);
- /* Add elemnt into the hash table before syncing state so we know about it
- * when elements are added */
pad = gst_ghost_pad_new (name, subpad);
+ g_assert (pad != NULL);
+
audiobin = audio_bin_new (pad, bin, volume, sink);
g_hash_table_insert (self->priv->audio_bins, pad, audiobin);
+ gst_element_set_locked_state (GST_ELEMENT (bin), FALSE);
+
if (!gst_element_sync_state_with_parent (bin))
goto error;