[PATCH v2] coreaudio: Notify error in coreaudio_init_out

Akihiko Odaki posted 1 patch 2 years, 2 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20220226115953.60335-1-akihiko.odaki@gmail.com
Test checkpatch passed
Maintainers: Gerd Hoffmann <kraxel@redhat.com>, Christian Schoenebeck <qemu_oss@crudebyte.com>, Akihiko Odaki <akihiko.odaki@gmail.com>
audio/coreaudio.c | 2 ++
1 file changed, 2 insertions(+)
[PATCH v2] coreaudio: Notify error in coreaudio_init_out
Posted by Akihiko Odaki 2 years, 2 months ago
Otherwise, the audio subsystem tries to use the voice and
eventually aborts due to the maximum number of samples in the
buffer is not set.

Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com>
Reviewed-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
---
 audio/coreaudio.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/audio/coreaudio.c b/audio/coreaudio.c
index d8a21d3e507..d7cfdcc4fc4 100644
--- a/audio/coreaudio.c
+++ b/audio/coreaudio.c
@@ -604,6 +604,8 @@ static int coreaudio_init_out(HWVoiceOut *hw, struct audsettings *as,
             coreaudio_playback_logerr(status,
                                       "Could not remove voice property change listener\n");
         }
+
+        return -1;
     }
 
     return 0;
-- 
2.32.0 (Apple Git-132)
Re: [PATCH v2] coreaudio: Notify error in coreaudio_init_out
Posted by Philippe Mathieu-Daudé 2 years, 1 month ago
On 26/2/22 12:59, Akihiko Odaki wrote:
> Otherwise, the audio subsystem tries to use the voice and
> eventually aborts due to the maximum number of samples in the
> buffer is not set.
> 
> Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com>
> Reviewed-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
> ---
>   audio/coreaudio.c | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/audio/coreaudio.c b/audio/coreaudio.c
> index d8a21d3e507..d7cfdcc4fc4 100644
> --- a/audio/coreaudio.c
> +++ b/audio/coreaudio.c
> @@ -604,6 +604,8 @@ static int coreaudio_init_out(HWVoiceOut *hw, struct audsettings *as,
>               coreaudio_playback_logerr(status,
>                                         "Could not remove voice property change listener\n");
>           }
> +
> +        return -1;
>       }
>   
>       return 0;

Merged as commit bd7819de22.
Re: [PATCH v2] coreaudio: Notify error in coreaudio_init_out
Posted by Philippe Mathieu-Daudé 2 years, 2 months ago
On 26/2/22 12:59, Akihiko Odaki wrote:
> Otherwise, the audio subsystem tries to use the voice and
> eventually aborts due to the maximum number of samples in the
> buffer is not set.
> 
> Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com>
> Reviewed-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
> ---
>   audio/coreaudio.c | 2 ++
>   1 file changed, 2 insertions(+)

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>