diff options
author | liamwhite <liamwhite@users.noreply.github.com> | 2023-07-02 04:38:18 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-02 04:38:18 +0200 |
commit | 971b89b979cb3b903263234f3a6fdd2bceb03cbe (patch) | |
tree | d32c8012765d9d94c57292ddfac3f84ec247a6e1 /src/core/hle/service/audio/hwopus.cpp | |
parent | Merge pull request #10966 from Morph1984/heap-corruption (diff) | |
parent | parcel: Optimize small_vector sizes (diff) | |
download | yuzu-971b89b979cb3b903263234f3a6fdd2bceb03cbe.tar yuzu-971b89b979cb3b903263234f3a6fdd2bceb03cbe.tar.gz yuzu-971b89b979cb3b903263234f3a6fdd2bceb03cbe.tar.bz2 yuzu-971b89b979cb3b903263234f3a6fdd2bceb03cbe.tar.lz yuzu-971b89b979cb3b903263234f3a6fdd2bceb03cbe.tar.xz yuzu-971b89b979cb3b903263234f3a6fdd2bceb03cbe.tar.zst yuzu-971b89b979cb3b903263234f3a6fdd2bceb03cbe.zip |
Diffstat (limited to 'src/core/hle/service/audio/hwopus.cpp')
-rw-r--r-- | src/core/hle/service/audio/hwopus.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/core/hle/service/audio/hwopus.cpp b/src/core/hle/service/audio/hwopus.cpp index c835f6cb7..fa77007f3 100644 --- a/src/core/hle/service/audio/hwopus.cpp +++ b/src/core/hle/service/audio/hwopus.cpp @@ -11,6 +11,7 @@ #include "common/assert.h" #include "common/logging/log.h" +#include "common/scratch_buffer.h" #include "core/hle/service/audio/hwopus.h" #include "core/hle/service/ipc_helpers.h" @@ -68,13 +69,13 @@ private: ExtraBehavior extra_behavior) { u32 consumed = 0; u32 sample_count = 0; - tmp_samples.resize_destructive(ctx.GetWriteBufferNumElements<opus_int16>()); + samples.resize_destructive(ctx.GetWriteBufferNumElements<opus_int16>()); if (extra_behavior == ExtraBehavior::ResetContext) { ResetDecoderContext(); } - if (!DecodeOpusData(consumed, sample_count, ctx.ReadBuffer(), tmp_samples, performance)) { + if (!DecodeOpusData(consumed, sample_count, ctx.ReadBuffer(), samples, performance)) { LOG_ERROR(Audio, "Failed to decode opus data"); IPC::ResponseBuilder rb{ctx, 2}; // TODO(ogniK): Use correct error code @@ -90,7 +91,7 @@ private: if (performance) { rb.Push<u64>(*performance); } - ctx.WriteBuffer(tmp_samples); + ctx.WriteBuffer(samples); } bool DecodeOpusData(u32& consumed, u32& sample_count, std::span<const u8> input, @@ -154,7 +155,7 @@ private: OpusDecoderPtr decoder; u32 sample_rate; u32 channel_count; - Common::ScratchBuffer<opus_int16> tmp_samples; + Common::ScratchBuffer<opus_int16> samples; }; class IHardwareOpusDecoderManager final : public ServiceFramework<IHardwareOpusDecoderManager> { |