changeset 27882:d865064a3104

Switch around some GStreamer linking and state setting. Hopefully this fixes the occasional freezing of the stream on startup.
author maiku@pidgin.im
date Wed, 12 Aug 2009 10:03:47 +0000
parents 8ae062f94489
children 359800ae7d17
files libpurple/media.c libpurple/mediamanager.c
diffstat 2 files changed, 8 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- 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);
 	}
 
--- 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);
 		}
 	}