diff options
| author | 2023-02-15 17:42:38 -0500 | |
|---|---|---|
| committer | 2023-02-15 17:42:38 -0500 | |
| commit | 04d2d2ef5fdd56baa0ecf60e59ea4e915262161d (patch) | |
| tree | 3951ff8988fff573acd7f2b4edf5d95774b3721d /src/audio_core/sink | |
| parent | Merge pull request #9809 from liamwhite/unused-service (diff) | |
| parent | remove constexpr from virtual function (diff) | |
| download | yuzu-04d2d2ef5fdd56baa0ecf60e59ea4e915262161d.tar.gz yuzu-04d2d2ef5fdd56baa0ecf60e59ea4e915262161d.tar.xz yuzu-04d2d2ef5fdd56baa0ecf60e59ea4e915262161d.zip | |
Merge pull request #9782 from arades79/fix-consexpr-value-declaration-usage
Fix consexpr value declaration usage
Diffstat (limited to 'src/audio_core/sink')
| -rw-r--r-- | src/audio_core/sink/sink_stream.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/audio_core/sink/sink_stream.cpp b/src/audio_core/sink/sink_stream.cpp index 06c2a876e..2fb5f9758 100644 --- a/src/audio_core/sink/sink_stream.cpp +++ b/src/audio_core/sink/sink_stream.cpp | |||
| @@ -35,7 +35,7 @@ void SinkStream::AppendBuffer(SinkBuffer& buffer, std::vector<s16>& samples) { | |||
| 35 | 35 | ||
| 36 | if (system_channels == 6 && device_channels == 2) { | 36 | if (system_channels == 6 && device_channels == 2) { |
| 37 | // We're given 6 channels, but our device only outputs 2, so downmix. | 37 | // We're given 6 channels, but our device only outputs 2, so downmix. |
| 38 | constexpr std::array<f32, 4> down_mix_coeff{1.0f, 0.707f, 0.251f, 0.707f}; | 38 | static constexpr std::array<f32, 4> down_mix_coeff{1.0f, 0.707f, 0.251f, 0.707f}; |
| 39 | 39 | ||
| 40 | for (u32 read_index = 0, write_index = 0; read_index < samples.size(); | 40 | for (u32 read_index = 0, write_index = 0; read_index < samples.size(); |
| 41 | read_index += system_channels, write_index += device_channels) { | 41 | read_index += system_channels, write_index += device_channels) { |
| @@ -202,7 +202,7 @@ void SinkStream::ProcessAudioOutAndRender(std::span<s16> output_buffer, std::siz | |||
| 202 | // If we're paused or going to shut down, we don't want to consume buffers as coretiming is | 202 | // If we're paused or going to shut down, we don't want to consume buffers as coretiming is |
| 203 | // paused and we'll desync, so just play silence. | 203 | // paused and we'll desync, so just play silence. |
| 204 | if (system.IsPaused() || system.IsShuttingDown()) { | 204 | if (system.IsPaused() || system.IsShuttingDown()) { |
| 205 | constexpr std::array<s16, 6> silence{}; | 205 | static constexpr std::array<s16, 6> silence{}; |
| 206 | for (size_t i = frames_written; i < num_frames; i++) { | 206 | for (size_t i = frames_written; i < num_frames; i++) { |
| 207 | std::memcpy(&output_buffer[i * frame_size], &silence[0], frame_size_bytes); | 207 | std::memcpy(&output_buffer[i * frame_size], &silence[0], frame_size_bytes); |
| 208 | } | 208 | } |