summaryrefslogtreecommitdiffstats
path: root/src/audio_core/codec.cpp
diff options
context:
space:
mode:
authorMerry <MerryMage@users.noreply.github.com>2017-09-26 09:47:37 +0200
committerGitHub <noreply@github.com>2017-09-26 09:47:37 +0200
commit0c20da7fde7ed659977ce145e003c6b2f42b7290 (patch)
treefb0624e37338033ae84a8948be5c235ec8d4f1dd /src/audio_core/codec.cpp
parentMerge pull request #2947 from Subv/selfncch_factory (diff)
parentAudio: Use std::deque instead of std::vector for the audio buffer type (StereoBuffer16). (diff)
downloadyuzu-0c20da7fde7ed659977ce145e003c6b2f42b7290.tar
yuzu-0c20da7fde7ed659977ce145e003c6b2f42b7290.tar.gz
yuzu-0c20da7fde7ed659977ce145e003c6b2f42b7290.tar.bz2
yuzu-0c20da7fde7ed659977ce145e003c6b2f42b7290.tar.lz
yuzu-0c20da7fde7ed659977ce145e003c6b2f42b7290.tar.xz
yuzu-0c20da7fde7ed659977ce145e003c6b2f42b7290.tar.zst
yuzu-0c20da7fde7ed659977ce145e003c6b2f42b7290.zip
Diffstat (limited to '')
-rw-r--r--src/audio_core/codec.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/audio_core/codec.cpp b/src/audio_core/codec.cpp
index 7a3bd7eb3..6fba9fdae 100644
--- a/src/audio_core/codec.cpp
+++ b/src/audio_core/codec.cpp
@@ -117,7 +117,9 @@ StereoBuffer16 DecodePCM16(const unsigned num_channels, const u8* const data,
ret[i].fill(sample);
}
} else {
- std::memcpy(ret.data(), data, sample_count * 2 * sizeof(u16));
+ for (size_t i = 0; i < sample_count; ++i) {
+ std::memcpy(&ret[i], data + i * sizeof(s16) * 2, 2 * sizeof(s16));
+ }
}
return ret;