[empathy] recycle the audio output gst element
- From: Guillaume Desmottes <gdesmott src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [empathy] recycle the audio output gst element
- Date: Thu, 1 Apr 2010 08:16:11 +0000 (UTC)
commit 688514d4d5cca5ad23d6b9c54506252089ac5b49
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date: Wed Dec 2 17:15:27 2009 +0000
recycle the audio output gst element
There is no point to create a new one for each call.
src/empathy-call-window.c | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/src/empathy-call-window.c b/src/empathy-call-window.c
index 4a63017..f1d3e7b 100644
--- a/src/empathy-call-window.c
+++ b/src/empathy-call-window.c
@@ -608,7 +608,14 @@ initialize_output_elements (GstBus *bus, EmpathyCallWindow *self)
GDK_BUTTON_PRESS_MASK | GDK_POINTER_MOTION_MASK);
g_signal_connect (G_OBJECT (priv->video_output), "button-press-event",
G_CALLBACK (empathy_call_window_video_button_press_cb), self);
+}
+
+static void
+create_audio_output (EmpathyCallWindow *self)
+{
+ EmpathyCallWindowPriv *priv = GET_PRIV (self);
+ g_assert (priv->audio_output == NULL);
priv->audio_output = empathy_audio_sink_new ();
gst_object_ref (priv->audio_output);
gst_object_sink (priv->audio_output);
@@ -1008,6 +1015,7 @@ empathy_call_window_init (EmpathyCallWindow *self)
priv->self_user_output_hbox);
create_pipeline (self);
+ create_audio_output (self);
priv->fsnotifier = fs_element_added_notifier_new ();
fs_element_added_notifier_add (priv->fsnotifier, GST_BIN (priv->pipeline));
@@ -1497,10 +1505,6 @@ empathy_call_window_reset_pipeline (EmpathyCallWindow *self)
g_signal_handlers_disconnect_by_func (priv->audio_input_adj,
empathy_call_window_mic_volume_changed_cb, self);
- if (priv->audio_output != NULL)
- g_object_unref (priv->audio_output);
- priv->audio_output = NULL;
-
if (priv->video_tee != NULL)
g_object_unref (priv->video_tee);
priv->video_tee = NULL;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]