From 9e27ff64d9fc9bd9207b9526a37fddd5d9e8d111 Mon Sep 17 00:00:00 2001 From: Stefan Reinauer Date: Sun, 31 May 2026 00:19:10 -0700 Subject: [PATCH] sndboard: disable recording if capture setup fails codec_start() allocated the record buffer even when host capture setup failed. Treat that as recording unavailable, clear the record bit, free the buffer, and leave playback running. --- sndboard.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sndboard.cpp b/sndboard.cpp index 68ba3706..573d604e 100644 --- a/sndboard.cpp +++ b/sndboard.cpp @@ -1679,7 +1679,12 @@ static void codec_start(struct snddev_data *data) if (data->snddev_active & STATUS_FIFO_RECORD) { data->capture_buffer_size = 48000 * 2 * 2; // 1s at 48000/stereo/16bit data->capture_buffer = xcalloc(uae_u8, data->capture_buffer_size); - sndboard_init_capture(data->freq_adjusted); + if (!sndboard_init_capture(data->freq_adjusted)) { + write_log(_T("SNDDEV capture unavailable, recording disabled\n")); + data->snddev_active &= ~STATUS_FIFO_RECORD; + xfree(data->capture_buffer); + data->capture_buffer = NULL; + } } } -- 2.47.3