summaryrefslogtreecommitdiffstats
path: root/src/audio_core/sdl2_sink.cpp
diff options
context:
space:
mode:
authorMerryMage <MerryMage@users.noreply.github.com>2016-08-31 17:55:10 +0200
committerMerryMage <MerryMage@users.noreply.github.com>2016-08-31 17:55:10 +0200
commit0ef4185644def3e7d99d88af3c8dd27d40660c82 (patch)
tree0a6b8f018184ea30b5b8471520bd426b6de52b65 /src/audio_core/sdl2_sink.cpp
parentMerge pull request #2034 from JayFoxRox/avoid-glsl-error (diff)
downloadyuzu-0ef4185644def3e7d99d88af3c8dd27d40660c82.tar
yuzu-0ef4185644def3e7d99d88af3c8dd27d40660c82.tar.gz
yuzu-0ef4185644def3e7d99d88af3c8dd27d40660c82.tar.bz2
yuzu-0ef4185644def3e7d99d88af3c8dd27d40660c82.tar.lz
yuzu-0ef4185644def3e7d99d88af3c8dd27d40660c82.tar.xz
yuzu-0ef4185644def3e7d99d88af3c8dd27d40660c82.tar.zst
yuzu-0ef4185644def3e7d99d88af3c8dd27d40660c82.zip
Diffstat (limited to 'src/audio_core/sdl2_sink.cpp')
-rw-r--r--src/audio_core/sdl2_sink.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/audio_core/sdl2_sink.cpp b/src/audio_core/sdl2_sink.cpp
index dc75c04ee..311dd5b59 100644
--- a/src/audio_core/sdl2_sink.cpp
+++ b/src/audio_core/sdl2_sink.cpp
@@ -71,14 +71,12 @@ unsigned int SDL2Sink::GetNativeSampleRate() const {
return impl->sample_rate;
}
-void SDL2Sink::EnqueueSamples(const std::vector<s16>& samples) {
+void SDL2Sink::EnqueueSamples(const s16* samples, size_t sample_count) {
if (impl->audio_device_id <= 0)
return;
- ASSERT_MSG(samples.size() % 2 == 0, "Samples must be in interleaved stereo PCM16 format (size must be a multiple of two)");
-
SDL_LockAudioDevice(impl->audio_device_id);
- impl->queue.emplace_back(samples);
+ impl->queue.emplace_back(samples, samples + sample_count * 2);
SDL_UnlockAudioDevice(impl->audio_device_id);
}