mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-04-20 03:24:49 +00:00
Avoid processing job buffers before codec initialization (#2507)
This commit is contained in:
parent
0aaeea4837
commit
4f1baece33
2 changed files with 6 additions and 0 deletions
|
@ -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…
Add table
Reference in a new issue