diff options
author | Sjoerd Simons <sjoerd@luon.net> | 2012-05-21 19:44:06 +0800 |
---|---|---|
committer | Sjoerd Simons <sjoerd@luon.net> | 2012-05-21 19:54:00 +0800 |
commit | 108b3fa233660bdd0e88ac2d4642a75efa8f1eb7 (patch) | |
tree | 8f3cb4e27792f05da2c5ab1a137db457afa3bd1d | |
parent | d524cc36152688f8475f14eb2bfd17bcb1e34b3f (diff) | |
download | gsoc2013-empathy-108b3fa233660bdd0e88ac2d4642a75efa8f1eb7.tar gsoc2013-empathy-108b3fa233660bdd0e88ac2d4642a75efa8f1eb7.tar.gz gsoc2013-empathy-108b3fa233660bdd0e88ac2d4642a75efa8f1eb7.tar.bz2 gsoc2013-empathy-108b3fa233660bdd0e88ac2d4642a75efa8f1eb7.tar.lz gsoc2013-empathy-108b3fa233660bdd0e88ac2d4642a75efa8f1eb7.tar.xz gsoc2013-empathy-108b3fa233660bdd0e88ac2d4642a75efa8f1eb7.tar.zst gsoc2013-empathy-108b3fa233660bdd0e88ac2d4642a75efa8f1eb7.zip |
audiosrc: Don't use stream volumes properties if the src doesn't support them
-rw-r--r-- | src/empathy-audio-src.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/empathy-audio-src.c b/src/empathy-audio-src.c index 5a82979aa..ca086148f 100644 --- a/src/empathy-audio-src.c +++ b/src/empathy-audio-src.c @@ -75,6 +75,7 @@ struct _EmpathyGstAudioSrcPrivate gdouble volume; gboolean mute; + gboolean have_stream_volume; GMutex *lock; guint level_idle_id; @@ -97,7 +98,8 @@ empathy_audio_set_hw_mute (EmpathyGstAudioSrc *self, gboolean mute) if (mute == self->priv->mute) return; - g_object_set (self->priv->src, "mute", mute, NULL); + if (self->priv->have_stream_volume) + g_object_set (self->priv->src, "mute", mute, NULL); /* Belt and braces: If for some reason the underlying src doesn't mute * correctly or doesn't update us when it unmutes correctly enforce it using @@ -124,7 +126,8 @@ empathy_audio_src_set_hw_volume (EmpathyGstAudioSrc *self, if (volume == self->priv->volume) return; - g_object_set (self->priv->src, "volume", volume, NULL); + if (self->priv->have_stream_volume) + g_object_set (self->priv->src, "volume", volume, NULL); self->priv->volume = volume; } @@ -293,6 +296,8 @@ empathy_audio_src_init (EmpathyGstAudioSrc *obj) { gdouble volume; gboolean mute; + + priv->have_stream_volume = TRUE; /* We can't do a bidirection bind as the ::notify comes from another * thread, for other bits of empathy it's most simpler if it comes from * the main thread */ @@ -313,6 +318,11 @@ empathy_audio_src_init (EmpathyGstAudioSrc *obj) g_signal_connect (priv->src, "notify::mute", G_CALLBACK (empathy_audio_src_volume_changed), obj); } + else + { + g_message ("No stream volume available :(, mute will work though"); + priv->have_stream_volume = FALSE; + } gst_bin_add (GST_BIN (obj), priv->src); |