# HG changeset patch # User maiku@pidgin.im # Date 1251018752 0 # Node ID afa79877d972827166ea56c22b461f63d3504870 # Parent 3571b38c1a7edc5235b56105eb7d75bc1a7593bf Detect that there has been an error in the GStreamer pipeline, output an appropriate message and end the conference. diff -r 3571b38c1a7e -r afa79877d972 libpurple/media.c --- a/libpurple/media.c Sun Aug 23 07:08:19 2009 +0000 +++ b/libpurple/media.c Sun Aug 23 09:12:32 2009 +0000 @@ -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; }