aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSjoerd Simons <sjoerd.simons@collabora.co.uk>2011-10-13 01:12:05 +0800
committerSjoerd Simons <sjoerd.simons@collabora.co.uk>2011-10-13 01:18:00 +0800
commit4ec40a51cb71576e253c162a61d07e8b6cca78a1 (patch)
treeb948ab813f42268edb81348a0fb6c6b6afb4ae51 /src
parenta2776503c54bbd5cf4dec7cb7fd962b641145d50 (diff)
downloadgsoc2013-empathy-4ec40a51cb71576e253c162a61d07e8b6cca78a1.tar
gsoc2013-empathy-4ec40a51cb71576e253c162a61d07e8b6cca78a1.tar.gz
gsoc2013-empathy-4ec40a51cb71576e253c162a61d07e8b6cca78a1.tar.bz2
gsoc2013-empathy-4ec40a51cb71576e253c162a61d07e8b6cca78a1.tar.lz
gsoc2013-empathy-4ec40a51cb71576e253c162a61d07e8b6cca78a1.tar.xz
gsoc2013-empathy-4ec40a51cb71576e253c162a61d07e8b6cca78a1.tar.zst
gsoc2013-empathy-4ec40a51cb71576e253c162a61d07e8b6cca78a1.zip
Don't try to access non-existing properties
Diffstat (limited to 'src')
-rw-r--r--src/empathy-audio-src.c25
1 files changed, 20 insertions, 5 deletions
diff --git a/src/empathy-audio-src.c b/src/empathy-audio-src.c
index 203082dce..6378dd009 100644
--- a/src/empathy-audio-src.c
+++ b/src/empathy-audio-src.c
@@ -92,6 +92,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 +115,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 +163,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;
@@ -562,7 +577,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)
{