Commit 461632f0b1 for qemu.org
commit 461632f0b1cb2c5c29ba9875857637e3356b903c
Author: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
Date: Wed Mar 4 15:16:59 2026 +0900
coreaudio: Initialize the buffer for device change
Reallocate buffers when the active device change as the required buffer
size may differ.
Signed-off-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
Reviewed-by: Phil Dennis-Jordan <phil@philjordan.eu>
Acked-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
Reviewed-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20260304-coreaudio-v8-6-bf1d40731e73@rsg.ci.i.u-tokyo.ac.jp>
diff --git a/audio/coreaudio.m b/audio/coreaudio.m
index 23c3d1f80a..e4ec1df971 100644
--- a/audio/coreaudio.m
+++ b/audio/coreaudio.m
@@ -471,6 +471,7 @@ static OSStatus init_out_device(CoreaudioVoiceOut *core)
core->device_id = device_id;
core->device_frame_size = device_frame_size;
core->hw.samples = core->buffer_count * core->device_frame_size;
+ audio_generic_initialize_buffer_out(&core->hw);
core->ioprocid = ioprocid;
return 0;