aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAndreas Pehrson <[email protected]>2024-07-04 22:09:12 +0200
committerAndreas Pehrson <[email protected]>2024-07-04 22:16:18 +0200
commit714ab57f8f86b19beb98618cc9036b23477488bb (patch)
tree038713c3d05ec90d5fd2a011bb9a3ef2e7a45417
parent5d5008d25cef5237711b500f7d8a8653942530f1 (diff)
downloadcubeb-714ab57f8f86b19beb98618cc9036b23477488bb.tar.gz
cubeb-714ab57f8f86b19beb98618cc9036b23477488bb.zip
Reset stream params on initaaudio-reset-params
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.
-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",