# HG changeset patch # User maiku@pidgin.im # Date 1250071427 0 # Node ID d865064a3104ae7335cbcd8e60894a54eb78d234 # Parent 8ae062f94489bc0be842e0434b03b899bfb15026 Switch around some GStreamer linking and state setting. Hopefully this fixes the occasional freezing of the stream on startup. diff -r 8ae062f94489 -r d865064a3104 libpurple/media.c --- a/libpurple/media.c Sun Aug 09 22:06:37 2009 +0000 +++ b/libpurple/media.c Wed Aug 12 10:03:47 2009 +0000 @@ -2463,12 +2463,12 @@ gst_bin_add(GST_BIN(priv->confbin), stream->volume); gst_bin_add(GST_BIN(priv->confbin), stream->level); gst_bin_add(GST_BIN(priv->confbin), sink); + gst_element_set_state(sink, GST_STATE_PLAYING); + gst_element_set_state(stream->level, GST_STATE_PLAYING); + gst_element_set_state(stream->volume, GST_STATE_PLAYING); gst_element_link(stream->level, sink); gst_element_link(stream->volume, stream->level); gst_element_link(queue, stream->volume); - gst_element_sync_state_with_parent(sink); - gst_element_sync_state_with_parent(stream->level); - gst_element_sync_state_with_parent(stream->volume); sink = queue; } else if (codec->media_type == FS_MEDIA_TYPE_VIDEO) { stream->src = gst_element_factory_make( @@ -2481,9 +2481,9 @@ stream->tee = gst_element_factory_make("tee", NULL); gst_bin_add_many(GST_BIN(priv->confbin), stream->src, stream->tee, NULL); - gst_element_sync_state_with_parent(sink); - gst_element_sync_state_with_parent(stream->tee); - gst_element_sync_state_with_parent(stream->src); + gst_element_set_state(sink, GST_STATE_PLAYING); + gst_element_set_state(stream->tee, GST_STATE_PLAYING); + gst_element_set_state(stream->src, GST_STATE_PLAYING); gst_element_link_many(stream->src, stream->tee, sink, NULL); } diff -r 8ae062f94489 -r d865064a3104 libpurple/mediamanager.c --- a/libpurple/mediamanager.c Sun Aug 09 22:06:37 2009 +0000 +++ b/libpurple/mediamanager.c Wed Aug 12 10:03:47 2009 +0000 @@ -751,9 +751,9 @@ G_CALLBACK(window_id_cb), ow); gst_object_unref(bus); - gst_element_sync_state_with_parent(ow->sink); + gst_element_set_state(ow->sink, GST_STATE_PLAYING); + gst_element_set_state(queue, GST_STATE_PLAYING); gst_element_link(queue, ow->sink); - gst_element_sync_state_with_parent(queue); gst_element_link(tee, queue); } }