aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorAndreas Pehrson <[email protected]>2024-07-04 22:09:12 +0200
committerMatthew Gregan <[email protected]>2024-07-05 11:02:26 +1200
commit89573c99c7496545b05d5e25bcf57a2ac98bd3f9 (patch)
tree038713c3d05ec90d5fd2a011bb9a3ef2e7a45417 /src
parent5d5008d25cef5237711b500f7d8a8653942530f1 (diff)
downloadcubeb-89573c99c7496545b05d5e25bcf57a2ac98bd3f9.tar.gz
cubeb-89573c99c7496545b05d5e25bcf57a2ac98bd3f9.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/cubeb_aaudio.cpp4
1 files changed, 4 insertions, 0 deletions
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<cubeb_stream_params>();
*(stm->output_stream_params) = *output_stream_params;
+ } else {
+ stm->output_stream_params = nullptr;
}
if (input_stream_params) {
stm->input_stream_params = std::make_unique<cubeb_stream_params>();
*(stm->input_stream_params) = *input_stream_params;
+ } else {
+ stm->input_stream_params = nullptr;
}
LOG("cubeb stream prefs: voice_input: %s voice_output: %s",