Skip to contentSkip to conversation

coreaudio: Always return 0 in handle_voice_change

PATCH In review Akihiko Odaki 2 participants 2 messages Mar 6, 2022

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 coreaudio: Always return 0 in handle_voice_change

handle_voice_change() is a CoreAudio callback function as of CoreAudio type AudioObjectPropertyListenerProc, and for the latter MacOSX.sdk/System/ Library/Frameworks/CoreAudio.framework/Headers/AudioHardware.h says "The return value is currently unused and should always be 0.".

---
 audio/coreaudio.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
audio/coreaudio.c +2 -4
index 0f19d0ce01c..91445096358 100644
@@ -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,
Signature · 1 line
2.32.0 (Apple Git-132)
Reviewed-by on v2 1/1
#1 lore raw
Quoted 9 lines · Akihiko Odaki

handle_voice_change() is a CoreAudio callback function as of CoreAudio type AudioObjectPropertyListenerProc, and for the latter MacOSX.sdk/System/ Library/Frameworks/CoreAudio.framework/Headers/AudioHardware.h says "The return value is currently unused and should always be 0.".

---
  audio/coreaudio.c | 6 ++----
  1 file changed, 2 insertions(+), 4 deletions(-)