[Xfce4-commits] [apps/xfce4-volumed-pulse] 55/62: fix errors in full debug mode

noreply at xfce.org noreply at xfce.org
Thu Sep 8 10:33:17 CEST 2016


This is an automated email from the git hooks/post-receive script.

ochosi pushed a commit to branch master
in repository apps/xfce4-volumed-pulse.

commit 2a3192b933f4081faa0d02b093409243d1f2d531
Author: Lionel Le Folgoc <lionel at lefolgoc.net>
Date:   Fri May 25 21:38:58 2012 +0200

    fix errors in full debug mode
---
 src/xvd_notify.c |  4 +++-
 src/xvd_pulse.c  | 25 +++++++++++++++++++++----
 src/xvd_xfconf.c |  4 ++--
 3 files changed, 26 insertions(+), 7 deletions(-)

diff --git a/src/xvd_notify.c b/src/xvd_notify.c
index c70117e..4a3e0f3 100644
--- a/src/xvd_notify.c
+++ b/src/xvd_notify.c
@@ -103,10 +103,12 @@ void
 xvd_notify_init(XvdInstance *Inst, 
 				const gchar *appname)
 {
+	GList *caps_list = NULL;
+
 	Inst->gauge_notifications = TRUE;
 	notify_init (appname);
 	
-	GList *caps_list = notify_get_server_caps ();
+	caps_list = notify_get_server_caps ();
 	
 	if (caps_list)
 	{
diff --git a/src/xvd_pulse.c b/src/xvd_pulse.c
index dafb48c..f04804e 100644
--- a/src/xvd_pulse.c
+++ b/src/xvd_pulse.c
@@ -205,7 +205,7 @@ xvd_get_readable_volume (const pa_cvolume *vol)
   guint new_vol = 0;
 
   new_vol = 100 * pa_cvolume_avg (vol) / PA_VOLUME_NORM;
-  return CLAMP (new_vol, 0, 100);
+  return MIN (new_vol, 100);
 }
 
 
@@ -317,7 +317,7 @@ xvd_subscribed_events_callback (pa_context                     *c,
           return;
 
         if ((t & PA_SUBSCRIPTION_EVENT_TYPE_MASK) == PA_SUBSCRIPTION_EVENT_REMOVE)
-          i->sink_index == PA_INVALID_INDEX;
+          i->sink_index = PA_INVALID_INDEX;
         else
           {
              op = pa_context_get_sink_info_by_index (c,
@@ -369,11 +369,28 @@ xvd_context_state_callback (pa_context *c,
 
   switch (pa_context_get_state (c))
     {
+      case PA_CONTEXT_UNCONNECTED:
+        g_debug ("xvd_context_state_callback: The context hasn't been connected yet");
+      break;
+      case PA_CONTEXT_CONNECTING:
+        g_debug ("xvd_context_state_callback: A connection is being established");
+      break;
+      case PA_CONTEXT_AUTHORIZING:
+        g_debug ("xvd_context_state_callback: The client is authorizing itself to the daemon");
+      break;
+      case PA_CONTEXT_SETTING_NAME:
+        g_debug ("xvd_context_state_callback: The client is passing its application name to the daemon");
+      break;
+      case PA_CONTEXT_TERMINATED:
+        g_debug ("xvd_context_state_callback: The connection was terminated cleanly");
+        i->sink_index = PA_INVALID_INDEX;
+      break;
       case PA_CONTEXT_FAILED:
-        g_critical("xvd_context_state_callback: PA_CONTEXT_FAILED, is PulseAudio Daemon running?");
-        return;
+        g_critical("xvd_context_state_callback: The connection failed or was disconnected, is PulseAudio Daemon running?");
+        i->sink_index = PA_INVALID_INDEX;
       break;
       case PA_CONTEXT_READY:
+        g_debug ("xvd_context_state_callback: The connection is established, the context is ready to execute operations");
         pa_context_set_subscribe_callback (c,
                                            xvd_subscribed_events_callback,
                                            userdata);
diff --git a/src/xvd_xfconf.c b/src/xvd_xfconf.c
index b1409df..0a18d90 100644
--- a/src/xvd_xfconf.c
+++ b/src/xvd_xfconf.c
@@ -60,8 +60,8 @@ xvd_xfconf_init(XvdInstance *Inst)
 void 
 xvd_xfconf_get_vol_step(XvdInstance *Inst)
 {
-	Inst->vol_step = xfconf_channel_get_uint (Inst->chan, XFCONF_MIXER_VOL_STEP, -1);
-	if ((Inst->vol_step < 0) || (Inst->vol_step > 100)) {
+	Inst->vol_step = xfconf_channel_get_uint (Inst->chan, XFCONF_MIXER_VOL_STEP, VOL_STEP_DEFAULT_VAL);
+	if (Inst->vol_step > 100) {
 		g_debug ("%s\n", "The volume step xfconf property is out of range, setting back to default");
 		Inst->vol_step = VOL_STEP_DEFAULT_VAL;
 		xfconf_channel_set_uint (Inst->chan, XFCONF_MIXER_VOL_STEP, VOL_STEP_DEFAULT_VAL);

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list