From 714ab57f8f86b19beb98618cc9036b23477488bb Mon Sep 17 00:00:00 2001 From: Andreas Pehrson Date: Thu, 4 Jul 2024 22:09:12 +0200 Subject: Reset stream params on init Without a reset, a duplex stream being reused as an output stream will open an input stream and provide an input buffer, which is not expected. --- src/cubeb_aaudio.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/cubeb_aaudio.cpp b/src/cubeb_aaudio.cpp index 5f38c43..c9e4a25 100644 --- a/src/cubeb_aaudio.cpp +++ b/src/cubeb_aaudio.cpp @@ -1293,10 +1293,14 @@ aaudio_stream_init(cubeb * ctx, cubeb_stream ** stream, if (output_stream_params) { stm->output_stream_params = std::make_unique(); *(stm->output_stream_params) = *output_stream_params; + } else { + stm->output_stream_params = nullptr; } if (input_stream_params) { stm->input_stream_params = std::make_unique(); *(stm->input_stream_params) = *input_stream_params; + } else { + stm->input_stream_params = nullptr; } LOG("cubeb stream prefs: voice_input: %s voice_output: %s", -- cgit v1.2.3