mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2026-04-06 16:45:32 -06:00
Avoid processing job buffers before codec initialization (#2507)
Some checks are pending
Build and Release / reuse (push) Waiting to run
Build and Release / clang-format (push) Waiting to run
Build and Release / get-info (push) Waiting to run
Build and Release / windows-sdl (push) Blocked by required conditions
Build and Release / windows-qt (push) Blocked by required conditions
Build and Release / macos-sdl (push) Blocked by required conditions
Build and Release / macos-qt (push) Blocked by required conditions
Build and Release / linux-sdl (push) Blocked by required conditions
Build and Release / linux-qt (push) Blocked by required conditions
Build and Release / linux-sdl-gcc (push) Blocked by required conditions
Build and Release / linux-qt-gcc (push) Blocked by required conditions
Build and Release / pre-release (push) Blocked by required conditions
Some checks are pending
Build and Release / reuse (push) Waiting to run
Build and Release / clang-format (push) Waiting to run
Build and Release / get-info (push) Waiting to run
Build and Release / windows-sdl (push) Blocked by required conditions
Build and Release / windows-qt (push) Blocked by required conditions
Build and Release / macos-sdl (push) Blocked by required conditions
Build and Release / macos-qt (push) Blocked by required conditions
Build and Release / linux-sdl (push) Blocked by required conditions
Build and Release / linux-qt (push) Blocked by required conditions
Build and Release / linux-sdl-gcc (push) Blocked by required conditions
Build and Release / linux-qt-gcc (push) Blocked by required conditions
Build and Release / pre-release (push) Blocked by required conditions
This commit is contained in:
parent
0aaeea4837
commit
4f1baece33
@ -66,6 +66,7 @@ void AjmInstance::ExecuteJob(AjmJob& job) {
|
||||
LOG_TRACE(Lib_Ajm, "Initializing instance {}", job.instance_id);
|
||||
auto& params = job.input.init_params.value();
|
||||
m_codec->Initialize(¶ms, sizeof(params));
|
||||
is_initialized = true;
|
||||
}
|
||||
if (job.input.resample_parameters.has_value()) {
|
||||
LOG_ERROR(Lib_Ajm, "Unimplemented: resample parameters");
|
||||
@ -89,6 +90,10 @@ void AjmInstance::ExecuteJob(AjmJob& job) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!is_initialized) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!job.input.buffer.empty() && !job.output.buffers.empty()) {
|
||||
std::span<u8> in_buf(job.input.buffer);
|
||||
SparseOutputBuffer out_buf(job.output.buffers);
|
||||
|
||||
@ -96,6 +96,7 @@ private:
|
||||
AjmSidebandResampleParameters m_resample_parameters{};
|
||||
u32 m_total_samples{};
|
||||
std::unique_ptr<AjmCodec> m_codec;
|
||||
bool is_initialized = false;
|
||||
};
|
||||
|
||||
} // namespace Libraries::Ajm
|
||||
|
||||
Loading…
Reference in New Issue
Block a user