Mercurial > pidgin.yaz
diff libpurple/media.c @ 29693:7925bb7f2aa7
propagate from branch 'im.pidgin.pidgin' (head 92e101e3698042e7600729bc09dec9e28f81de8f)
to branch 'im.pidgin.cpw.attention_ui' (head 563c35d20efcc234a74567ebb88c059d10ce1e09)
author | Marcus Lundblad <ml@update.uu.se> |
---|---|
date | Mon, 24 Aug 2009 19:23:56 +0000 |
parents | afa79877d972 |
children | 0775b7b7298e |
line wrap: on
line diff
--- a/libpurple/media.c Thu Aug 13 17:42:44 2009 +0000 +++ b/libpurple/media.c Mon Aug 24 19:23:56 2009 +0000 @@ -21,7 +21,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */ #include <string.h> @@ -2129,6 +2129,35 @@ } break; } + case GST_MESSAGE_ERROR: { + GstElement *element = GST_ELEMENT(GST_MESSAGE_SRC(msg)); + GstElement *lastElement = NULL; + while (!GST_IS_PIPELINE(element)) { + if (element == media->priv->confbin) { + purple_media_error("media", _("Conference error.")); + purple_media_end(media, NULL, NULL); + break; + } + lastElement = element; + element = GST_ELEMENT_PARENT(element); + } + if (GST_IS_PIPELINE(element)) { + GList *sessions = g_hash_table_get_values(media->priv->sessions); + for (; sessions; sessions = g_list_delete_link(sessions, sessions)) { + PurpleMediaSession *session = sessions->data; + + if (session->src == lastElement) { + if (session->type & PURPLE_MEDIA_AUDIO) + purple_media_error(media, _("Error with your microphone.")); + else + purple_media_error(media, _("Error with your webcam.")); + purple_media_end(media, NULL, NULL); + break; + } + } + g_list_free(sessions); + } + } default: break; } @@ -2730,10 +2759,13 @@ num_params, params, &err); } - if (err) { - purple_debug_error("media", "Error creating stream: %s\n", - err->message); - g_error_free(err); + if (fsstream == NULL) { + purple_debug_error("media", + "Error creating stream: %s\n", + err && err->message ? + err->message : "NULL"); + if (err) + g_error_free(err); g_object_unref(participant); g_hash_table_remove(media->priv->participants, who); purple_media_remove_session(media, session);