diff options
author | Morph <39850852+Morph1984@users.noreply.github.com> | 2023-06-25 03:58:23 +0200 |
---|---|---|
committer | Morph <39850852+Morph1984@users.noreply.github.com> | 2023-07-01 03:49:59 +0200 |
commit | 310b6cf4af940fa07666400426bbcca815c5375c (patch) | |
tree | d3de4ddab952c5404be38035ece48773c0be41ac /src/core/hle/service/audio/hwopus.cpp | |
parent | ring_buffer: Fix const usage on std::span (diff) | |
download | yuzu-310b6cf4af940fa07666400426bbcca815c5375c.tar yuzu-310b6cf4af940fa07666400426bbcca815c5375c.tar.gz yuzu-310b6cf4af940fa07666400426bbcca815c5375c.tar.bz2 yuzu-310b6cf4af940fa07666400426bbcca815c5375c.tar.lz yuzu-310b6cf4af940fa07666400426bbcca815c5375c.tar.xz yuzu-310b6cf4af940fa07666400426bbcca815c5375c.tar.zst yuzu-310b6cf4af940fa07666400426bbcca815c5375c.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> { |