mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-07 12:10:09 +02:00
Fix serializing silence flags
We didn't initialize the field, and we also didn't copy the updated value back (since everything else is a pointer to the original data). This fixes audio channels in REAPER randomly being silence, as this field would otherwise be uninitialized. Thanks a lot to @kytdkut for finding this issue!
This commit is contained in:
@@ -233,6 +233,15 @@ Steinberg::Vst::ProcessData& YaProcessData::get() {
|
||||
}
|
||||
|
||||
YaProcessDataResponse YaProcessData::move_outputs_to_response() {
|
||||
// NOTE: We _have_ to manually copy over the silence flags from the
|
||||
// `ProcessData` object generated in `get()` here sicne these of
|
||||
// course are not references or pointers like all other fields, so
|
||||
// they're not implicitly copied like all of our other fields
|
||||
for (int i = 0; i < reconstructed_process_data.numOutputs; i++) {
|
||||
outputs[i].silence_flags =
|
||||
reconstructed_process_data.outputs[i].silenceFlags;
|
||||
}
|
||||
|
||||
return YaProcessDataResponse{
|
||||
.outputs = std::move(outputs),
|
||||
.output_parameter_changes = std::move(output_parameter_changes),
|
||||
|
||||
Reference in New Issue
Block a user