/pidgin/main: d5f8a3399782: Merge the last pr from the public tree

Gary Kramlich grim at reaperworld.com
Mon Jun 20 20:10:08 EDT 2016


Changeset: d5f8a33997829bdb9e0fee8375e519555d5a1e94
Author:	 Gary Kramlich <grim at reaperworld.com>
Date:	 2016-06-18 21:11 -0500
Branch:	 release-2.x.y
URL: https://hg.pidgin.im/pidgin/main/rev/d5f8a3399782

Description:

Merge the last pr from the public tree

diffstat:

 libpurple/media/backend-fs2.c |  11 +++++++++++
 libpurple/mediamanager.c      |  39 ++++++++++++++++++++++++++++++++++++---
 pidgin/gtkft.c                |   4 +++-
 3 files changed, 50 insertions(+), 4 deletions(-)

diffs (122 lines):

diff --git a/libpurple/media/backend-fs2.c b/libpurple/media/backend-fs2.c
--- a/libpurple/media/backend-fs2.c
+++ b/libpurple/media/backend-fs2.c
@@ -533,6 +533,8 @@ static void
 purple_media_backend_fs2_class_init(PurpleMediaBackendFs2Class *klass)
 {
 	GObjectClass *gobject_class = (GObjectClass*)klass;
+	GList *features;
+	GList *it;
 
 	gobject_class->dispose = purple_media_backend_fs2_dispose;
 	gobject_class->finalize = purple_media_backend_fs2_finalize;
@@ -544,6 +546,15 @@ purple_media_backend_fs2_class_init(Purp
 	g_object_class_override_property(gobject_class, PROP_MEDIA, "media");
 
 	g_type_class_add_private(klass, sizeof(PurpleMediaBackendFs2Private));
+
+	/* VA-API elements aren't well supported in Farstream. Ignore them. */
+	features = gst_registry_get_feature_list_by_plugin(gst_registry_get(),
+			"vaapi");
+	for (it = features; it; it = it->next) {
+		gst_plugin_feature_set_rank((GstPluginFeature *)it->data,
+				GST_RANK_NONE);
+	}
+	gst_plugin_feature_list_free(features);
 }
 
 static void
diff --git a/libpurple/mediamanager.c b/libpurple/mediamanager.c
--- a/libpurple/mediamanager.c
+++ b/libpurple/mediamanager.c
@@ -491,14 +491,18 @@ purple_media_manager_remove_media(Purple
 
 #ifdef HAVE_MEDIA_APPLICATION
 		g_mutex_lock (&manager->priv->appdata_mutex);
-		for (list = manager->priv->appdata_info; list; list = list->next) {
+		list = manager->priv->appdata_info;
+		while (list) {
 			PurpleMediaAppDataInfo *info = list->data;
+			GList *next = list->next;
 
 			if (info->media == media) {
 				manager->priv->appdata_info = g_list_delete_link (
 					manager->priv->appdata_info, list);
 				free_appdata_info_locked (info);
 			}
+
+			list = next;
 		}
 		g_mutex_unlock (&manager->priv->appdata_mutex);
 #endif
@@ -558,9 +562,24 @@ purple_media_manager_get_private_media_b
 static void
 free_appdata_info_locked (PurpleMediaAppDataInfo *info)
 {
+	GstAppSrcCallbacks null_src_cb = { NULL, NULL, NULL, { NULL } };
+	GstAppSinkCallbacks null_sink_cb = { NULL, NULL, NULL , { NULL } };
+
 	if (info->notify)
 		info->notify (info->user_data);
 
+	info->media = NULL;
+	if (info->appsrc) {
+		/* Will call appsrc_destroyed. */
+		gst_app_src_set_callbacks (info->appsrc, &null_src_cb,
+				NULL, NULL);
+	}
+	if (info->appsink) {
+		/* Will call appsink_destroyed. */
+		gst_app_sink_set_callbacks (info->appsink, &null_sink_cb,
+				NULL, NULL);
+	}
+
 	/* Make sure no other thread is using the structure */
 	g_free (info->session_id);
 	g_free (info->participant);
@@ -867,7 +886,14 @@ appsrc_seek_data (GstAppSrc *appsrc, gui
 static void
 appsrc_destroyed (PurpleMediaAppDataInfo *info)
 {
-	PurpleMediaManager *manager = purple_media_manager_get ();
+	PurpleMediaManager *manager;
+
+	if (!info->media) {
+		/* PurpleMediaAppDataInfo is being freed. Return at once. */
+		return;
+	}
+
+	manager = purple_media_manager_get ();
 
 	g_mutex_lock (&manager->priv->appdata_mutex);
 	info->appsrc = NULL;
@@ -1025,7 +1051,14 @@ appsink_new_sample (GstAppSink *appsink,
 static void
 appsink_destroyed (PurpleMediaAppDataInfo *info)
 {
-	PurpleMediaManager *manager = purple_media_manager_get ();
+	PurpleMediaManager *manager;
+
+	if (!info->media) {
+		/* PurpleMediaAppDataInfo is being freed. Return at once. */
+		return;
+	}
+
+	manager = purple_media_manager_get ();
 
 	g_mutex_lock (&manager->priv->appdata_mutex);
 	info->appsink = NULL;
diff --git a/pidgin/gtkft.c b/pidgin/gtkft.c
--- a/pidgin/gtkft.c
+++ b/pidgin/gtkft.c
@@ -504,7 +504,9 @@ open_button_cb(GtkButton *button, Pidgin
 	}
 	else
 	{
-		purple_notify_uri(NULL, filename);
+		gchar *uri = g_strdup_printf("file://%s", filename);
+		purple_notify_uri(NULL, uri);
+		g_free(uri);
 		return;
 	}
 



More information about the Commits mailing list