Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package callaudiod for openSUSE:Factory 
checked in at 2023-05-29 22:47:53
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/callaudiod (Old)
 and      /work/SRC/openSUSE:Factory/.callaudiod.new.1533 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "callaudiod"

Mon May 29 22:47:53 2023 rev:3 rq:1089547 version:0.1.7

Changes:
--------
--- /work/SRC/openSUSE:Factory/callaudiod/callaudiod.changes    2022-09-29 
18:15:23.131493430 +0200
+++ /work/SRC/openSUSE:Factory/.callaudiod.new.1533/callaudiod.changes  
2023-05-29 22:48:08.822420843 +0200
@@ -1,0 +2,24 @@
+Fri Mar 03 14:10:48 UTC 2023 - andrea.manz...@suse.com
+
+- Update to version 0.1.7:
+  * Release version 0.1.7
+  * libcallaudio: Properly handle successful return code
+  * Release version 0.1.6
+  * libcallaudio: Set error in sync API if unsuccessful
+  * libcallaudio: Drop DBus method return value in sync and async functions
+  * libcallaudio: Make logging consistent between sync and async API
+  * libcallaudio: Distinguish DBus error from unsuccessful operations
+  * libcallaudio: Prefer using FALSE instead of 0
+  * Release version 0.1.5
+  * cad-pulse: relax card filtering even more
+  * cad-pulse: stop polling for new cards
+  * cad-pulse: relax card filtering
+  * cad-pulse: fix segfault when there is no target port
+  * cad-manager: Don't return error on unsuccessful operations
+  * cad-manager: Return TRUE when returning error for DBus method invocation
+  * libcallaudio: Fix typo in documentation
+  * build: Enable more warnings
+  * cad-manager: Avoid magic constant
+  * cli: return non zero exit status on failure
+
+-------------------------------------------------------------------

Old:
----
  callaudiod-0.1.4.obscpio

New:
----
  callaudiod-0.1.7.obscpio
  callaudiod-0.1.7.tar.xz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ callaudiod.spec ++++++
--- /var/tmp/diff_new_pack.n0rVF2/_old  2023-05-29 22:48:09.382424192 +0200
+++ /var/tmp/diff_new_pack.n0rVF2/_new  2023-05-29 22:48:09.390424240 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package callaudiod
 #
-# Copyright (c) 2021 SUSE LLC
+# Copyright (c) 2023 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -15,12 +15,12 @@
 # Please submit bugfixes or comments via https://bugs.opensuse.org/
 #
 
+
 %define soname libcallaudio0_1-0
 %define apiver 0.1
 
-
 Name:           callaudiod
-Version:        0.1.4
+Version:        0.1.7
 Release:        0
 Summary:        Daemon for audio calls
 License:        GPL-3.0-or-later AND MIT

++++++ _service ++++++
--- /var/tmp/diff_new_pack.n0rVF2/_old  2023-05-29 22:48:09.418424408 +0200
+++ /var/tmp/diff_new_pack.n0rVF2/_new  2023-05-29 22:48:09.422424431 +0200
@@ -1,7 +1,7 @@
 <services>
   <service mode="disabled" name="obs_scm">
     <param name="url">https://gitlab.com/mobian1/callaudiod.git</param>
-    <param name="revision">refs/tags/0.1.4</param>
+    <param name="revision">refs/tags/0.1.7</param>
     <param name="versionformat">@PARENT_TAG@</param>
     <param name="scm">git</param>
     <param name="changesgenerate">enable</param>

++++++ _servicedata ++++++
--- /var/tmp/diff_new_pack.n0rVF2/_old  2023-05-29 22:48:09.442424551 +0200
+++ /var/tmp/diff_new_pack.n0rVF2/_new  2023-05-29 22:48:09.446424575 +0200
@@ -1,6 +1,6 @@
 <servicedata>
 <service name="tar_scm">
                 <param 
name="url">https://gitlab.com/mobian1/callaudiod.git</param>
-              <param 
name="changesrevision">a7ca6ce9d4c947f19c3f99ff2cab986c64434e57</param></service></servicedata>
+              <param 
name="changesrevision">92cf20a93903fe3d7969f4002643b011011243f7</param></service></servicedata>
 (No newline at EOF)
 

++++++ callaudiod-0.1.4.obscpio -> callaudiod-0.1.7.obscpio ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/callaudiod-0.1.4/libcallaudio/libcallaudio.c 
new/callaudiod-0.1.7/libcallaudio/libcallaudio.c
--- old/callaudiod-0.1.4/libcallaudio/libcallaudio.c    2022-03-25 
09:58:37.000000000 +0100
+++ new/callaudiod-0.1.7/libcallaudio/libcallaudio.c    2023-01-10 
16:31:54.000000000 +0100
@@ -24,7 +24,7 @@
  *
  *    int main(void)
  *    {
- *       g_autoptr(GError) *err = NULL;
+ *       g_autoptr(GError) err = NULL;
  *       if (call_audio_init(&err)) {
  *         g_error("%s", err->message);
  *       }
@@ -107,14 +107,15 @@
 
     ret = call_audio_dbus_call_audio_call_select_mode_finish(proxy, &success,
                                                              result, &error);
-    if (!ret || !success) {
-        g_warning("SelectMode failed with code %d: %s", success, 
error->message);
-    }
+    if (!ret)
+        g_warning("SelectMode DBus method invocation failed: %s", 
error->message);
+    else if (!success)
+        g_warning("SelectMode unsuccessful");
 
     g_debug("%s: D-bus call returned %d (success=%d)", __func__, ret, success);
 
     if (async_data && async_data->cb)
-        async_data->cb(ret && success, error, async_data->user_data);
+        async_data->cb(success, error, async_data->user_data);
     g_free(async_data);
 }
 
@@ -165,12 +166,16 @@
 
     ret = call_audio_dbus_call_audio_call_select_mode_sync(_proxy, mode, 
&success,
                                                            NULL, error);
-    if (error && *error)
-        g_critical("Couldn't set mode %u: %s", mode, (*error)->message);
+    if (!ret) {
+        g_warning("SelectMode DBus method invocation failed: %s", 
(*error)->message);
+    } else if (!success) {
+        g_warning("SelectMode (%u) unsuccessful", mode);
+        g_set_error_literal(error, G_IO_ERROR, G_IO_ERROR_FAILED, "Operation 
failed");
+    }
 
     g_debug("SelectMode %s: success=%d", ret ? "succeeded" : "failed", 
success);
 
-    return (ret && success);
+    return success;
 }
 
 /**
@@ -198,14 +203,15 @@
 
     ret = call_audio_dbus_call_audio_call_enable_speaker_finish(proxy, 
&success,
                                                                 result, 
&error);
-    if (!ret || !success) {
-        g_warning("EnableSpeaker failed with code %d: %s", success, 
error->message);
-    }
+    if (!ret)
+        g_warning("EnableSpeaker DBus method invocation failed: %s", 
error->message);
+    else if (!success)
+        g_warning("EnableSpeaker unsuccessful");
 
     g_debug("%s: D-bus call returned %d (success=%d)", __func__, ret, success);
 
     if (async_data && async_data->cb)
-        async_data->cb(ret && success, error, async_data->user_data);
+        async_data->cb(success, error, async_data->user_data);
     g_free(async_data);
 }
 
@@ -270,12 +276,16 @@
 
     ret = call_audio_dbus_call_audio_call_enable_speaker_sync(_proxy, enable, 
&success,
                                                               NULL, error);
-    if (error && *error)
-        g_critical("Couldn't enable speaker: %s", (*error)->message);
+    if (!ret) {
+        g_warning("EnableSpeaker DBus method invocation failed: %s", 
(*error)->message);
+    } else if (!success) {
+        g_warning("EnableSpeaker (%sable) unsuccessful", enable ? "en" : 
"dis");
+        g_set_error_literal(error, G_IO_ERROR, G_IO_ERROR_FAILED, "Operation 
failed");
+    }
 
     g_debug("EnableSpeaker %s: success=%d", ret ? "succeeded" : "failed", 
success);
 
-    return (ret && success);
+    return success;
 }
 
 static void mute_mic_done(GObject *object, GAsyncResult *result, gpointer data)
@@ -283,20 +293,22 @@
     CallAudioDbusCallAudio *proxy = CALL_AUDIO_DBUS_CALL_AUDIO(object);
     CallAudioAsyncData *async_data = data;
     GError *error = NULL;
-    gboolean success = 0;
+    gboolean success = FALSE;
     gboolean ret;
 
     g_return_if_fail(CALL_AUDIO_DBUS_IS_CALL_AUDIO(proxy));
 
     ret = call_audio_dbus_call_audio_call_mute_mic_finish(proxy, &success,
                                                           result, &error);
-    if (!ret || !success)
-        g_warning("MuteMic failed with code %d: %s", success, error->message);
+    if (!ret)
+        g_warning("MuteMic DBus method invocation failed: %s", error->message);
+    else if (!success)
+        g_warning("MuteMic unsuccessful");
 
     g_debug("%s: D-bus call returned %d (success=%d)", __func__, ret, success);
 
     if (async_data && async_data->cb)
-        async_data->cb(ret && success, error, async_data->user_data);
+        async_data->cb(success, error, async_data->user_data);
     g_free(async_data);
 }
 
@@ -347,12 +359,16 @@
 
     ret = call_audio_dbus_call_audio_call_mute_mic_sync(_proxy, mute, &success,
                                                         NULL, error);
-    if (error && *error)
-        g_critical("Couldn't mute mic: %s", (*error)->message);
+    if (!ret) {
+        g_warning("MuteMic DBus method invocation failed: %s", 
(*error)->message);
+    } else if (!success) {
+        g_warning("MuteMic (%smute) unsuccessful", mute ? "" : "un");
+        g_set_error_literal(error, G_IO_ERROR, G_IO_ERROR_FAILED, "Operation 
failed");
+    }
 
     g_debug("MuteMic %s: success=%d", ret ? "succeeded" : "failed", success);
 
-    return (ret && success);
+    return success;
 }
 
 /**
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/callaudiod-0.1.4/meson.build 
new/callaudiod-0.1.7/meson.build
--- old/callaudiod-0.1.4/meson.build    2022-03-25 09:58:37.000000000 +0100
+++ new/callaudiod-0.1.7/meson.build    2023-01-10 16:31:54.000000000 +0100
@@ -8,7 +8,7 @@
 project (
   'callaudiod',
   'c',
-  version : '0.1.4',
+  version : '0.1.7',
   license : 'LGPLv3+',
   meson_version : '>= 0.50.0',
   default_options :
@@ -21,6 +21,56 @@
 
 cc = meson.get_compiler('c')
 
+cc = meson.get_compiler('c')
+
+global_c_args = []
+test_c_args = [
+  '-Wcast-align',
+  '-Wdate-time',
+  '-Wdeclaration-after-statement',
+  ['-Werror=format-security', '-Werror=format=2'],
+  '-Wendif-labels',
+  '-Werror=incompatible-pointer-types',
+  '-Werror=missing-declarations',
+  '-Werror=overflow',
+  '-Werror=return-type',
+  '-Werror=shift-count-overflow',
+  '-Werror=shift-overflow=2',
+  '-Werror=implicit-fallthrough=3',
+  '-Wfloat-equal',
+  '-Wformat-nonliteral',
+  '-Wformat-security',
+  '-Winit-self',
+  '-Wmaybe-uninitialized',
+  '-Wmissing-field-initializers',
+  '-Wmissing-include-dirs',
+  '-Wmissing-noreturn',
+  '-Wnested-externs',
+  '-Wno-missing-field-initializers',
+  '-Wno-sign-compare',
+  '-Wno-strict-aliasing',
+  '-Wno-unused-parameter',
+  '-Wold-style-definition',
+  '-Wpointer-arith',
+  '-Wredundant-decls',
+  '-Wshadow',
+  '-Wstrict-prototypes',
+  '-Wswitch-default',
+  '-Wswitch-enum',
+  '-Wtype-limits',
+  '-Wundef',
+  '-Wunused-function',
+]
+foreach arg: test_c_args
+  if cc.has_multi_arguments(arg)
+    global_c_args += arg
+  endif
+endforeach
+add_project_arguments(
+  global_c_args,
+  language: 'c'
+)
+
 app_name = meson.project_name()
 
 prefix = get_option('prefix')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/callaudiod-0.1.4/src/cad-manager.c 
new/callaudiod-0.1.7/src/cad-manager.c
--- old/callaudiod-0.1.4/src/cad-manager.c      2022-03-25 09:58:37.000000000 
+0100
+++ new/callaudiod-0.1.7/src/cad-manager.c      2023-01-10 16:31:54.000000000 
+0100
@@ -31,25 +31,22 @@
     if (!op)
         return;
 
-    if (op->success) {
-        switch (op->type) {
-        case CAD_OPERATION_SELECT_MODE:
-            call_audio_dbus_call_audio_complete_select_mode(op->object, 
op->invocation, op->success);
-            break;
-        case CAD_OPERATION_ENABLE_SPEAKER:
-            call_audio_dbus_call_audio_complete_enable_speaker(op->object, 
op->invocation, op->success);
-            break;
-        case CAD_OPERATION_MUTE_MIC:
-            call_audio_dbus_call_audio_complete_mute_mic(op->object, 
op->invocation, op->success);
-            break;
-        default:
-            g_critical("unknown operation %d", op->type);
-            break;
-        }
-    } else {
+    switch (op->type) {
+    case CAD_OPERATION_SELECT_MODE:
+        call_audio_dbus_call_audio_complete_select_mode(op->object, 
op->invocation, op->success);
+        break;
+    case CAD_OPERATION_ENABLE_SPEAKER:
+        call_audio_dbus_call_audio_complete_enable_speaker(op->object, 
op->invocation, op->success);
+        break;
+    case CAD_OPERATION_MUTE_MIC:
+        call_audio_dbus_call_audio_complete_mute_mic(op->object, 
op->invocation, op->success);
+        break;
+    default:
         g_dbus_method_invocation_return_error(op->invocation, G_DBUS_ERROR,
-                                              G_DBUS_ERROR_FAILED,
-                                              "Operation failed");
+                                              G_DBUS_ERROR_UNKNOWN_METHOD,
+                                              "Unknown operation");
+        g_critical("unknown operation %d", op->type);
+        break;
     }
 }
 
@@ -59,21 +56,19 @@
 {
     CadOperation *op;
 
-    if (mode >= 2) {
+    switch ((CallAudioMode)mode) {
+    case CALL_AUDIO_MODE_DEFAULT:
+    case CALL_AUDIO_MODE_CALL:
+        break;
+    case CALL_AUDIO_MODE_UNKNOWN:
+    default:
         g_dbus_method_invocation_return_error(invocation, G_DBUS_ERROR,
                                               G_DBUS_ERROR_INVALID_ARGS,
                                               "Invalid mode %u", mode);
-        return FALSE;
+        return TRUE;
     }
 
     op = g_new(CadOperation, 1);
-    if (!op) {
-        g_critical("Unable to allocate memory for select mode operation");
-        g_dbus_method_invocation_return_error(invocation, G_DBUS_ERROR,
-                                              G_DBUS_ERROR_NO_MEMORY,
-                                              "Failed to allocate operation");
-        return FALSE;
-    }
 
     op->type = CAD_OPERATION_SELECT_MODE;
     op->value = GUINT_TO_POINTER(mode);
@@ -100,13 +95,6 @@
     CadOperation *op;
 
     op = g_new(CadOperation, 1);
-    if (!op) {
-        g_critical("Unable to allocate memory for speaker operation");
-        g_dbus_method_invocation_return_error(invocation, G_DBUS_ERROR,
-                                              G_DBUS_ERROR_NO_MEMORY,
-                                              "Failed to allocate operation");
-        return FALSE;
-    }
 
     op->type = CAD_OPERATION_ENABLE_SPEAKER;
     op->value = GUINT_TO_POINTER(enable ? CALL_AUDIO_SPEAKER_ON : 
CALL_AUDIO_SPEAKER_OFF);
@@ -133,13 +121,6 @@
     CadOperation *op;
 
     op = g_new(CadOperation, 1);
-    if (!op) {
-        g_critical("Unable to allocate memory for mic operation");
-        g_dbus_method_invocation_return_error(invocation, G_DBUS_ERROR,
-                                              G_DBUS_ERROR_NO_MEMORY,
-                                              "Failed to allocate operation");
-        return FALSE;
-    }
 
     op->type = CAD_OPERATION_MUTE_MIC;
     op->value = GUINT_TO_POINTER(mute ? CALL_AUDIO_MIC_OFF : 
CALL_AUDIO_MIC_ON);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/callaudiod-0.1.4/src/cad-pulse.c 
new/callaudiod-0.1.7/src/cad-pulse.c
--- old/callaudiod-0.1.4/src/cad-pulse.c        2022-03-25 09:58:37.000000000 
+0100
+++ new/callaudiod-0.1.7/src/cad-pulse.c        2023-01-10 16:31:54.000000000 
+0100
@@ -23,7 +23,6 @@
 #define APPLICATION_ID   "org.mobian-project.CallAudio"
 
 #define SINK_CLASS "sound"
-#define CARD_BUS_PATH_PREFIX "platform-"
 #define CARD_FORM_FACTOR "internal"
 #define CARD_MODEM_CLASS "modem"
 #define CARD_MODEM_NAME "Modem"
@@ -63,7 +62,7 @@
 
 static void pulseaudio_cleanup(CadPulse *self);
 static gboolean pulseaudio_connect(CadPulse *self);
-static gboolean init_pulseaudio_objects(CadPulse *self);
+static gboolean init_pulseaudio_objects(gpointer data);
 
 /******************************************************************************
  * Source management
@@ -83,6 +82,7 @@
         pa_source_port_info *port = source->ports[i];
 
         if ((exclude && strcmp(port->name, exclude) == 0) ||
+            port->type != PA_DEVICE_PORT_TYPE_MIC ||
             port->available == PA_PORT_AVAILABLE_NO) {
             continue;
         }
@@ -316,7 +316,8 @@
     for (i = 0; i < info->n_ports; i++) {
         pa_sink_port_info *port = info->ports[i];
 
-        if (strstr(port->name, SND_USE_CASE_DEV_SPEAKER) != NULL) {
+        switch (port->type) {
+          case PA_DEVICE_PORT_TYPE_SPEAKER:
             if (self->speaker_port) {
                 if (strcmp(port->name, self->speaker_port) != 0) {
                     g_free(self->speaker_port);
@@ -325,7 +326,10 @@
             } else {
                 self->speaker_port = g_strdup(port->name);
             }
-        } else if (strstr(port->name, SND_USE_CASE_DEV_EARPIECE) != NULL) {
+            break;
+          case PA_DEVICE_PORT_TYPE_EARPIECE:
+          case PA_DEVICE_PORT_TYPE_HANDSET:
+          case PA_DEVICE_PORT_TYPE_HEADPHONES:
             if (self->earpiece_port) {
                 if (strcmp(port->name, self->earpiece_port) != 0) {
                     g_free(self->earpiece_port);
@@ -334,6 +338,9 @@
             } else {
                 self->earpiece_port = g_strdup(port->name);
             }
+            break;
+          default:
+            break;
         }
 
         if (port->available != PA_PORT_AVAILABLE_UNKNOWN) {
@@ -410,6 +417,7 @@
                 g_object_set(self->manager, "audio-mode", self->audio_mode, 
NULL);
             }
             break;
+        case CALL_AUDIO_MODE_DEFAULT:
         default:
             break;
         }
@@ -445,8 +453,7 @@
 
     if (eol != 0) {
         if (self->card_id < 0) {
-            g_critical("No suitable card found, retrying in 3s...");
-            g_timeout_add_seconds(3, G_SOURCE_FUNC(init_pulseaudio_objects), 
self);
+            g_critical("No suitable card found, stopping here...");
         }
         return;
     }
@@ -456,27 +463,30 @@
         return;
     }
 
-    prop = pa_proplist_gets(info->proplist, PA_PROP_DEVICE_BUS_PATH);
-    if (prop && !g_str_has_prefix(prop, CARD_BUS_PATH_PREFIX))
-        return;
-    prop = pa_proplist_gets(info->proplist, PA_PROP_DEVICE_FORM_FACTOR);
-    if (prop && strcmp(prop, CARD_FORM_FACTOR) != 0)
-        return;
     prop = pa_proplist_gets(info->proplist, "alsa.card_name");
-    if (prop && strcmp(prop, CARD_MODEM_NAME) == 0)
+    g_debug("CARD: prop %s = %s", "alsa.card_name", prop);
+    if (prop && strstr(prop, CARD_MODEM_NAME) != 0)
         return;
     prop = pa_proplist_gets(info->proplist, PA_PROP_DEVICE_CLASS);
+    g_debug("CARD: prop %s = %s", PA_PROP_DEVICE_CLASS, prop);
     if (prop && strcmp(prop, CARD_MODEM_CLASS) == 0)
         return;
 
     for (i = 0; i < info->n_ports; i++) {
         pa_card_port_info *port = info->ports[i];
+        g_debug("CARD: port %d/%d, name=%s", i, info->n_ports-1, port->name);
 
-        if (strstr(port->name, SND_USE_CASE_DEV_SPEAKER) != NULL) {
+        switch (port->type) {
+          case PA_DEVICE_PORT_TYPE_SPEAKER:
             has_speaker = TRUE;
-        } else if (strstr(port->name, SND_USE_CASE_DEV_EARPIECE) != NULL ||
-                   strstr(port->name, SND_USE_CASE_DEV_HANDSET)  != NULL) {
+            break;
+          case PA_DEVICE_PORT_TYPE_EARPIECE:
+          case PA_DEVICE_PORT_TYPE_HANDSET:
+          case PA_DEVICE_PORT_TYPE_HEADPHONES:
             has_earpiece = TRUE;
+            break;
+          default:
+            break;
         }
     }
 
@@ -547,8 +557,9 @@
     }
 }
 
-static gboolean init_pulseaudio_objects(CadPulse *self)
+static gboolean init_pulseaudio_objects(gpointer data)
 {
+    CadPulse *self = data;
     pa_operation *op;
 
     self->card_id = self->sink_id = self->source_id = -1;
@@ -598,7 +609,10 @@
         }
         break;
     case PA_SUBSCRIPTION_EVENT_CARD:
-        if (idx == self->card_id && kind == PA_SUBSCRIPTION_EVENT_CHANGE) {
+        if (self->card_id < 0 && kind == PA_SUBSCRIPTION_EVENT_NEW) {
+            g_debug("card %u added, but no valid card detected yet, 
retrying...", idx);
+            g_idle_add(init_pulseaudio_objects, self);
+        } else if (idx == self->card_id && kind == 
PA_SUBSCRIPTION_EVENT_CHANGE) {
             g_debug("card %u changed", idx);
             if (self->sink_id != -1) {
                 op = pa_context_get_sink_info_by_index(ctx, self->sink_id,
@@ -644,8 +658,10 @@
                              PA_SUBSCRIPTION_MASK_SINK  | 
PA_SUBSCRIPTION_MASK_SOURCE | PA_SUBSCRIPTION_MASK_CARD,
                              NULL, self);
         g_debug("PA is ready, initializing cards list");
-        init_pulseaudio_objects(self);
+        g_idle_add(init_pulseaudio_objects, self);
         break;
+    default:
+        g_return_if_reached();
     }
 }
 
@@ -893,7 +909,7 @@
 
     g_debug("active port is '%s', target port is '%s'", 
info->active_port->name, target_port);
 
-    if (strcmp(info->active_port->name, target_port) != 0) {
+    if (target_port && strcmp(info->active_port->name, target_port) != 0) {
         g_debug("switching to target port '%s'", target_port);
         op = pa_context_set_sink_port_by_index(ctx, operation->pulse->sink_id,
                                                target_port,
@@ -913,8 +929,8 @@
  * @mode:
  * @cad_op:
  *
- * */
-void cad_pulse_select_mode(guint mode, CadOperation *cad_op)
+ */
+void cad_pulse_select_mode(CallAudioMode mode, CadOperation *cad_op)
 {
     CadPulseOperation *operation = g_new(CadPulseOperation, 1);
     pa_operation *op = NULL;
@@ -923,10 +939,6 @@
         g_critical("%s: no callaudiod operation", __func__);
         goto error;
     }
-    if (!operation) {
-        g_critical("%s: unable to allocate memory", __func__);
-        goto error;
-    }
 
     /*
      * Make sure cad_op is of the correct type!
@@ -986,7 +998,8 @@
 error:
     if (cad_op) {
         cad_op->success = FALSE;
-        cad_op->callback(cad_op);
+        if (cad_op->callback)
+            cad_op->callback(cad_op);
     }
     if (operation)
         free(operation);
@@ -1001,10 +1014,6 @@
         g_critical("%s: no callaudiod operation", __func__);
         goto error;
     }
-    if (!operation) {
-        g_critical("%s: unable to allocate memory", __func__);
-        goto error;
-    }
 
     /*
      * Make sure cad_op is of the correct type!
@@ -1032,7 +1041,8 @@
 error:
     if (cad_op) {
         cad_op->success = FALSE;
-        cad_op->callback(cad_op);
+        if (cad_op->callback)
+            cad_op->callback(cad_op);
     }
     if (operation)
         free(operation);
@@ -1047,10 +1057,6 @@
         g_critical("%s: no callaudiod operation", __func__);
         goto error;
     }
-    if (!operation) {
-        g_critical("%s: unable to allocate memory", __func__);
-        goto error;
-    }
 
     /*
      * Make sure cad_op is of the correct type!
@@ -1091,7 +1097,8 @@
 error:
     if (cad_op) {
         cad_op->success = FALSE;
-        cad_op->callback(cad_op);
+        if (cad_op->callback)
+            cad_op->callback(cad_op);
     }
     if (operation)
         free(operation);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/callaudiod-0.1.4/src/cad-pulse.h 
new/callaudiod-0.1.7/src/cad-pulse.h
--- old/callaudiod-0.1.4/src/cad-pulse.h        2022-03-25 09:58:37.000000000 
+0100
+++ new/callaudiod-0.1.7/src/cad-pulse.h        2023-01-10 16:31:54.000000000 
+0100
@@ -19,7 +19,7 @@
 G_DECLARE_FINAL_TYPE(CadPulse, cad_pulse, CAD, PULSE, GObject);
 
 CadPulse *cad_pulse_get_default(void);
-void cad_pulse_select_mode(guint mode, CadOperation *op);
+void cad_pulse_select_mode(CallAudioMode mode, CadOperation *op);
 void cad_pulse_enable_speaker(gboolean enable, CadOperation *op);
 void cad_pulse_mute_mic(gboolean mute, CadOperation *op);
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/callaudiod-0.1.4/tools/callaudiocli.c 
new/callaudiod-0.1.7/tools/callaudiocli.c
--- old/callaudiod-0.1.4/tools/callaudiocli.c   2022-03-25 09:58:37.000000000 
+0100
+++ new/callaudiod-0.1.7/tools/callaudiocli.c   2023-01-10 16:31:54.000000000 
+0100
@@ -43,14 +43,23 @@
     if (mode == -1 && speaker == -1 && mic == -1)
         status = TRUE;
 
-    if (mode == CALL_AUDIO_MODE_DEFAULT || mode == CALL_AUDIO_MODE_CALL)
-        call_audio_select_mode(mode, NULL);
+    if (mode == CALL_AUDIO_MODE_DEFAULT || mode == CALL_AUDIO_MODE_CALL) {
+        if (!call_audio_select_mode(mode, &err)) {
+            return 1;
+        }
+    }
 
-    if (speaker == 0 || speaker == 1)
-        call_audio_enable_speaker((gboolean)speaker, NULL);
+    if (speaker == 0 || speaker == 1) {
+        if (!call_audio_enable_speaker((gboolean)speaker, &err)) {
+            return 1;
+        }
+    }
 
-    if (mic == 0 || mic == 1)
-        call_audio_mute_mic((gboolean)mic, NULL);
+    if (mic == 0 || mic == 1) {
+        if (!call_audio_mute_mic((gboolean)mic, &err)) {
+            return 1;
+        }
+    }
 
     if (status) {
         CallAudioMode audio_mode = call_audio_get_audio_mode();

++++++ callaudiod.obsinfo ++++++
--- /var/tmp/diff_new_pack.n0rVF2/_old  2023-05-29 22:48:09.578425365 +0200
+++ /var/tmp/diff_new_pack.n0rVF2/_new  2023-05-29 22:48:09.582425388 +0200
@@ -1,5 +1,5 @@
 name: callaudiod
-version: 0.1.4
-mtime: 1648198717
-commit: a7ca6ce9d4c947f19c3f99ff2cab986c64434e57
+version: 0.1.7
+mtime: 1673364714
+commit: 92cf20a93903fe3d7969f4002643b011011243f7
 

Reply via email to