aboutsummaryrefslogtreecommitdiffstats
path: root/src/empathy-audio-sink.c
diff options
context:
space:
mode:
authorSjoerd Simons <sjoerd.simons@collabora.co.uk>2011-03-14 17:37:43 +0800
committerEmilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>2011-06-09 17:20:07 +0800
commit0679051ae7301209a9eab4bd4995535f119e3462 (patch)
tree98ae858191f609e66bf0066e01ac34fa6f98d156 /src/empathy-audio-sink.c
parentc944633078a0769de5e50082e1d8b9e91565f940 (diff)
downloadgsoc2013-empathy-0679051ae7301209a9eab4bd4995535f119e3462.tar
gsoc2013-empathy-0679051ae7301209a9eab4bd4995535f119e3462.tar.gz
gsoc2013-empathy-0679051ae7301209a9eab4bd4995535f119e3462.tar.bz2
gsoc2013-empathy-0679051ae7301209a9eab4bd4995535f119e3462.tar.lz
gsoc2013-empathy-0679051ae7301209a9eab4bd4995535f119e3462.tar.xz
gsoc2013-empathy-0679051ae7301209a9eab4bd4995535f119e3462.tar.zst
gsoc2013-empathy-0679051ae7301209a9eab4bd4995535f119e3462.zip
Ensure our bin doesn't change state before being in the hash table
Diffstat (limited to 'src/empathy-audio-sink.c')
-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;