[audio] add splitter_size (#3477)
Thanks to: https://git.ryujinx.app/ryubing/ryujinx/-/merge_requests/257 Credits to Coxxs and his friend. Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3477 Reviewed-by: MaranBr <maranbr@eden-emu.dev> Reviewed-by: DraVee <dravee@eden-emu.dev> Reviewed-by: CamilleLaVey <camillelavey99@gmail.com> Co-authored-by: Maufeat <sahyno1996@gmail.com> Co-committed-by: Maufeat <sahyno1996@gmail.com>
This commit is contained in:
parent
6b3f8e1b62
commit
28a78d76fe
|
|
@ -1,4 +1,4 @@
|
||||||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
// SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project
|
// SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project
|
||||||
|
|
@ -616,12 +616,11 @@ Result InfoUpdater::UpdateErrorInfo(const BehaviorInfo& behaviour_) {
|
||||||
}
|
}
|
||||||
|
|
||||||
Result InfoUpdater::UpdateSplitterInfo(SplitterContext& splitter_context) {
|
Result InfoUpdater::UpdateSplitterInfo(SplitterContext& splitter_context) {
|
||||||
u32 consumed_size{0};
|
if (!splitter_context.Update(input)) {
|
||||||
if (!splitter_context.Update(input, consumed_size)) {
|
|
||||||
return Service::Audio::ResultInvalidUpdateInfo;
|
return Service::Audio::ResultInvalidUpdateInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
input += consumed_size;
|
input += in_header->splitter_size;
|
||||||
|
|
||||||
return ResultSuccess;
|
return ResultSuccess;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,6 @@
|
||||||
|
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||||
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
// SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project
|
// SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project
|
||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
|
|
@ -35,7 +38,7 @@ class InfoUpdater {
|
||||||
/* 0x18 */ u32 mix_size{};
|
/* 0x18 */ u32 mix_size{};
|
||||||
/* 0x1C */ u32 sinks_size{};
|
/* 0x1C */ u32 sinks_size{};
|
||||||
/* 0x20 */ u32 performance_buffer_size{};
|
/* 0x20 */ u32 performance_buffer_size{};
|
||||||
/* 0x24 */ char unk24[4];
|
/* 0x24 */ u32 splitter_size{};
|
||||||
/* 0x28 */ u32 render_info_size{};
|
/* 0x28 */ u32 render_info_size{};
|
||||||
/* 0x2C */ char unk2C[0x10];
|
/* 0x2C */ char unk2C[0x10];
|
||||||
/* 0x3C */ u32 size{sizeof(UpdateDataHeader)};
|
/* 0x3C */ u32 size{sizeof(UpdateDataHeader)};
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
// SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project
|
// SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project
|
||||||
|
|
@ -93,16 +93,14 @@ bool SplitterContext::Initialize(const BehaviorInfo& behavior,
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SplitterContext::Update(const u8* input, u32& consumed_size) {
|
bool SplitterContext::Update(const u8* input) {
|
||||||
auto in_params{reinterpret_cast<const InParameterHeader*>(input)};
|
auto in_params{reinterpret_cast<const InParameterHeader*>(input)};
|
||||||
|
|
||||||
if (destinations_count == 0 || info_count == 0) {
|
if (destinations_count == 0 || info_count == 0) {
|
||||||
consumed_size = 0;
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (in_params->magic != GetSplitterInParamHeaderMagic()) {
|
if (in_params->magic != GetSplitterInParamHeaderMagic()) {
|
||||||
consumed_size = 0;
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -113,8 +111,6 @@ bool SplitterContext::Update(const u8* input, u32& consumed_size) {
|
||||||
u32 offset{sizeof(InParameterHeader)};
|
u32 offset{sizeof(InParameterHeader)};
|
||||||
offset = UpdateInfo(input, offset, in_params->info_count);
|
offset = UpdateInfo(input, offset, in_params->info_count);
|
||||||
offset = UpdateData(input, offset, in_params->destination_count);
|
offset = UpdateData(input, offset, in_params->destination_count);
|
||||||
|
|
||||||
consumed_size = Common::AlignUp(offset, 0x10);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
// SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project
|
// SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project
|
||||||
|
|
@ -104,9 +104,8 @@ public:
|
||||||
*
|
*
|
||||||
* @param input - Input buffer with the new info,
|
* @param input - Input buffer with the new info,
|
||||||
* expected to point to a InParameterHeader.
|
* expected to point to a InParameterHeader.
|
||||||
* @param consumed_size - Output with the number of bytes consumed from input.
|
|
||||||
*/
|
*/
|
||||||
bool Update(const u8* input, u32& consumed_size);
|
bool Update(const u8* input);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update the splitters.
|
* Update the splitters.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue