comparison libpurple/mediamanager.c @ 25706:1c68f78414b7

Set the media pipeline to PLAYING immediately after initialization (and a few other changes to make it actually work and not hang).
author Mike Ruprecht <maiku@soc.pidgin.im>
date Thu, 17 Jul 2008 21:01:46 +0000
parents cbe97caec684
children b8a73b6dc0a4
comparison
equal deleted inserted replaced
25705:e23b447aa5ca 25706:1c68f78414b7
133 const char *conference_type, 133 const char *conference_type,
134 const char *remote_user) 134 const char *remote_user)
135 { 135 {
136 PurpleMedia *media; 136 PurpleMedia *media;
137 FsConference *conference = FS_CONFERENCE(gst_element_factory_make(conference_type, NULL)); 137 FsConference *conference = FS_CONFERENCE(gst_element_factory_make(conference_type, NULL));
138 GstStateChangeReturn ret = gst_element_set_state(GST_ELEMENT(conference), GST_STATE_READY); 138 GstStateChangeReturn ret;
139
140 if (ret == GST_STATE_CHANGE_FAILURE) {
141 purple_conv_present_error(remote_user,
142 purple_connection_get_account(gc),
143 _("Error creating conference."));
144 return NULL;
145 }
146 139
147 media = PURPLE_MEDIA(g_object_new(purple_media_get_type(), 140 media = PURPLE_MEDIA(g_object_new(purple_media_get_type(),
148 "screenname", remote_user, 141 "screenname", remote_user,
149 "connection", gc, 142 "connection", gc,
150 "farsight-conference", conference, 143 "farsight-conference", conference,
151 NULL)); 144 NULL));
145
146 ret = gst_element_set_state(purple_media_get_pipeline(media), GST_STATE_PLAYING);
147
148 if (ret == GST_STATE_CHANGE_FAILURE) {
149 purple_conv_present_error(remote_user,
150 purple_connection_get_account(gc),
151 _("Error creating conference."));
152 g_object_unref(media);
153 return NULL;
154 }
155
152 manager->priv->medias = g_list_append(manager->priv->medias, media); 156 manager->priv->medias = g_list_append(manager->priv->medias, media);
153 g_signal_emit(manager, purple_media_manager_signals[INIT_MEDIA], 0, media); 157 g_signal_emit(manager, purple_media_manager_signals[INIT_MEDIA], 0, media);
154 return media; 158 return media;
155 } 159 }
156 160