From: Volker Rümelin Date: Fri, 23 Sep 2022 18:36:30 +0000 (+0200) Subject: audio: fix GUS audio playback with out.mixing-engine=off X-Git-Tag: v7.2.0-rc0~51^2~24 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=7099a6a220c33d9c115e19e9f03ac61caa8358b5;p=users%2Fdwmw2%2Fqemu.git audio: fix GUS audio playback with out.mixing-engine=off Fix GUS audio playback with out.mixing-engine=off. The GUS audio device needs to know the amount of samples to produce in advance. To reproduce start qemu with -parallel none -device gus,audiodev=audio0 -audiodev pa,id=audio0,out.mixing-engine=off and start the cartoon.exe demo in a FreeDOS guest. The demo file is available on the download page of the GUSemu32 author. Signed-off-by: Volker Rümelin Acked-by: Marc-André Lureau Message-Id: <20220923183640.8314-2-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann --- diff --git a/audio/audio.c b/audio/audio.c index 08aec51e70..29da359b41 100644 --- a/audio/audio.c +++ b/audio/audio.c @@ -1139,7 +1139,8 @@ static void audio_run_out (AudioState *s) } if (sw->active) { - sw->callback.fn(sw->callback.opaque, INT_MAX); + sw->callback.fn(sw->callback.opaque, + hw_free * sw->info.bytes_per_frame); } continue;