qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] coreaudio: Always return 0 in handle_voice_change


From: Akihiko Odaki
Subject: Re: [PATCH] coreaudio: Always return 0 in handle_voice_change
Date: Sun, 6 Mar 2022 19:54:00 +0900
User-agent: Mozilla/5.0 (X11; Linux aarch64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0

On 2022/03/06 19:49, Christian Schoenebeck wrote:
On Sonntag, 6. März 2022 07:39:49 CET Akihiko Odaki wrote:
MacOSX.sdk/System/Library/Frameworks/CoreAudio.framework/Headers/AudioHardwa
re.h
says:
The return value is currently unused and should always be 0.

Where does it say that, about which macOS functions? There are quite a bunch
of macOS functions involved in init_out_device(), and they all have error
pathes in init_out_device(), and they still will have them after this patch.

And again, I'm missing: this as an improvement because? Is this a user
invisible improvement (e.g. removing redundant branches), or is this a user
visible improvement, i.e. does it fix a misbehaviour? In case of the latter,
which misbehaviour did you encounter?

handle_voice_change itself is a callback.
It is invisible for a user since "the return value is currently unused".

Regards,
Akihiko Odaki


Best regards,
Christian Schoenebeck


Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com>
---
  audio/coreaudio.c | 6 ++----
  1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/audio/coreaudio.c b/audio/coreaudio.c
index 0f19d0ce01c..91445096358 100644
--- a/audio/coreaudio.c
+++ b/audio/coreaudio.c
@@ -540,7 +540,6 @@ static OSStatus handle_voice_change(
      const AudioObjectPropertyAddress *in_addresses,
      void *in_client_data)
  {
-    OSStatus status;
      coreaudioVoiceOut *core = in_client_data;

      qemu_mutex_lock_iothread();
@@ -549,13 +548,12 @@ static OSStatus handle_voice_change(
          fini_out_device(core);
      }

-    status = init_out_device(core);
-    if (!status) {
+    if (!init_out_device(core)) {
          update_device_playback_state(core);
      }

      qemu_mutex_unlock_iothread();
-    return status;
+    return 0;
  }

  static int coreaudio_init_out(HWVoiceOut *hw, struct audsettings *as,






reply via email to

[Prev in Thread] Current Thread [Next in Thread]