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>
This commit is contained in:
Akihiko Odaki
2026-03-04 15:16:59 +09:00
committed by Marc-André Lureau
parent c3492514c7
commit 461632f0b1

View File

@@ -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;