From: Akihiko Odaki <akihiko.odaki@gmail.com>
To: Christian Schoenebeck <qemu_oss@crudebyte.com>, qemu-devel@nongnu.org
Cc: Gerd Hoffmann <kraxel@redhat.com>
Subject: Re: [PATCH] coreaudio: Always return 0 in handle_voice_change
Date: Sun, 6 Mar 2022 19:54:00 +0900 [thread overview]
Message-ID: <0fc7e092-49dd-4fb3-a365-f5399a4cb8b2@gmail.com> (raw)
In-Reply-To: <1771824.72ebOKuLVD@silver>
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,
>
>
next prev parent reply other threads:[~2022-03-06 10:57 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-06 6:39 [PATCH] coreaudio: Always return 0 in handle_voice_change Akihiko Odaki
2022-03-06 10:49 ` Christian Schoenebeck
2022-03-06 10:54 ` Akihiko Odaki [this message]
2022-03-06 12:16 ` Christian Schoenebeck
2022-03-06 12:30 ` Akihiko Odaki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0fc7e092-49dd-4fb3-a365-f5399a4cb8b2@gmail.com \
--to=akihiko.odaki@gmail.com \
--cc=kraxel@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu_oss@crudebyte.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).