diff options
Diffstat (limited to 'src/empathy-audio-src.c')
-rw-r--r-- | src/empathy-audio-src.c | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/src/empathy-audio-src.c b/src/empathy-audio-src.c index 203082dce..916f3cd98 100644 --- a/src/empathy-audio-src.c +++ b/src/empathy-audio-src.c @@ -27,7 +27,6 @@ #include "empathy-audio-src.h" -#include "src-marshal.h" #include "empathy-mic-monitor.h" #define DEBUG_FLAG EMPATHY_DEBUG_VOIP @@ -92,6 +91,21 @@ empathy_audio_src_supports_changing_mic (EmpathyGstAudioSrc *self) "source-output-index") != NULL); } +static guint +empathy_audio_src_get_mic_index (EmpathyGstAudioSrc *self) +{ + EmpathyGstAudioSrcPrivate *priv = EMPATHY_GST_AUDIO_SRC_GET_PRIVATE (self); + guint audio_src_idx = PA_INVALID_INDEX; + + if (empathy_audio_src_supports_changing_mic (self)) + g_object_get (priv->src, + "source-output-index", &audio_src_idx, + NULL); + + return audio_src_idx; +} + + static void empathy_audio_src_microphone_changed_cb (EmpathyMicMonitor *monitor, guint source_output_idx, @@ -100,9 +114,9 @@ empathy_audio_src_microphone_changed_cb (EmpathyMicMonitor *monitor, { EmpathyGstAudioSrc *self = user_data; EmpathyGstAudioSrcPrivate *priv = EMPATHY_GST_AUDIO_SRC_GET_PRIVATE (self); - guint audio_src_idx = PA_INVALID_INDEX; + guint audio_src_idx; - g_object_get (priv->src, "source-output-index", &audio_src_idx, NULL); + audio_src_idx = empathy_audio_src_get_mic_index (self); if (source_output_idx == PA_INVALID_INDEX || source_output_idx != audio_src_idx) @@ -148,9 +162,9 @@ empathy_audio_src_source_output_index_notify (GObject *object, EmpathyGstAudioSrc *self) { EmpathyGstAudioSrcPrivate *priv = EMPATHY_GST_AUDIO_SRC_GET_PRIVATE (self); - guint source_output_idx = PA_INVALID_INDEX; + guint source_output_idx; - g_object_get (priv->src, "source-output-index", &source_output_idx, NULL); + source_output_idx = empathy_audio_src_get_mic_index (self); if (source_output_idx == PA_INVALID_INDEX) return; @@ -336,7 +350,7 @@ empathy_audio_src_class_init (EmpathyGstAudioSrcClass G_SIGNAL_RUN_LAST, 0, NULL, NULL, - g_cclosure_marshal_VOID__DOUBLE, + g_cclosure_marshal_generic, G_TYPE_NONE, 1, G_TYPE_DOUBLE); param_spec = g_param_spec_double ("rms-level", "RMS level", "RMS level", @@ -349,7 +363,7 @@ empathy_audio_src_class_init (EmpathyGstAudioSrcClass G_SIGNAL_RUN_LAST, 0, NULL, NULL, - g_cclosure_marshal_VOID__DOUBLE, + g_cclosure_marshal_generic, G_TYPE_NONE, 1, G_TYPE_DOUBLE); } @@ -562,7 +576,7 @@ empathy_audio_src_change_microphone_async (EmpathyGstAudioSrc *src, return; } - g_object_get (priv->src, "source-output-index", &source_output_idx, NULL); + source_output_idx = empathy_audio_src_get_mic_index (src); if (source_output_idx == PA_INVALID_INDEX) { |