diff options
| author | 2020-07-12 22:13:48 +1000 | |
|---|---|---|
| committer | 2020-07-25 12:39:35 +1000 | |
| commit | d68856ab124adefd0ff52f6c120ecc03aee60365 (patch) | |
| tree | 5ffeb54569d5598d485521a91bff8d3b89ba96d4 /src | |
| parent | audio_core: Apollo Part 1, AudioRenderer refactor (diff) | |
| download | yuzu-d68856ab124adefd0ff52f6c120ecc03aee60365.tar.gz yuzu-d68856ab124adefd0ff52f6c120ecc03aee60365.tar.xz yuzu-d68856ab124adefd0ff52f6c120ecc03aee60365.zip | |
Disable time stretcher for time being
Diffstat (limited to 'src')
| -rw-r--r-- | src/audio_core/cubeb_sink.cpp | 4 | ||||
| -rw-r--r-- | src/audio_core/stream.cpp | 6 |
2 files changed, 4 insertions, 6 deletions
diff --git a/src/audio_core/cubeb_sink.cpp b/src/audio_core/cubeb_sink.cpp index cbd6c56da..a8315c6f7 100644 --- a/src/audio_core/cubeb_sink.cpp +++ b/src/audio_core/cubeb_sink.cpp | |||
| @@ -203,6 +203,7 @@ long CubebSinkStream::DataCallback(cubeb_stream* stream, void* user_data, const | |||
| 203 | const std::size_t samples_to_write = num_channels * num_frames; | 203 | const std::size_t samples_to_write = num_channels * num_frames; |
| 204 | std::size_t samples_written; | 204 | std::size_t samples_written; |
| 205 | 205 | ||
| 206 | /* | ||
| 206 | if (Settings::values.enable_audio_stretching.GetValue()) { | 207 | if (Settings::values.enable_audio_stretching.GetValue()) { |
| 207 | const std::vector<s16> in{impl->queue.Pop()}; | 208 | const std::vector<s16> in{impl->queue.Pop()}; |
| 208 | const std::size_t num_in{in.size() / num_channels}; | 209 | const std::size_t num_in{in.size() / num_channels}; |
| @@ -217,7 +218,8 @@ long CubebSinkStream::DataCallback(cubeb_stream* stream, void* user_data, const | |||
| 217 | } | 218 | } |
| 218 | } else { | 219 | } else { |
| 219 | samples_written = impl->queue.Pop(buffer, samples_to_write); | 220 | samples_written = impl->queue.Pop(buffer, samples_to_write); |
| 220 | } | 221 | }*/ |
| 222 | samples_written = impl->queue.Pop(buffer, samples_to_write); | ||
| 221 | 223 | ||
| 222 | if (samples_written >= num_channels) { | 224 | if (samples_written >= num_channels) { |
| 223 | std::memcpy(&impl->last_frame[0], buffer + (samples_written - num_channels) * sizeof(s16), | 225 | std::memcpy(&impl->last_frame[0], buffer + (samples_written - num_channels) * sizeof(s16), |
diff --git a/src/audio_core/stream.cpp b/src/audio_core/stream.cpp index f80ab92e4..c805b9d21 100644 --- a/src/audio_core/stream.cpp +++ b/src/audio_core/stream.cpp | |||
| @@ -103,11 +103,7 @@ void Stream::PlayNextBuffer(std::chrono::nanoseconds ns_late) { | |||
| 103 | 103 | ||
| 104 | sink_stream.EnqueueSamples(GetNumChannels(), active_buffer->GetSamples()); | 104 | sink_stream.EnqueueSamples(GetNumChannels(), active_buffer->GetSamples()); |
| 105 | 105 | ||
| 106 | const auto time_stretch_delta = Settings::values.enable_audio_stretching.GetValue() | 106 | core_timing.ScheduleEvent(GetBufferReleaseNS(*active_buffer) - ns_late, release_event, {}); |
| 107 | ? std::chrono::nanoseconds::zero() | ||
| 108 | : ns_late; | ||
| 109 | const auto future_time = GetBufferReleaseNS(*active_buffer) - time_stretch_delta; | ||
| 110 | core_timing.ScheduleEvent(future_time, release_event, {}); | ||
| 111 | } | 107 | } |
| 112 | 108 | ||
| 113 | void Stream::ReleaseActiveBuffer(std::chrono::nanoseconds ns_late) { | 109 | void Stream::ReleaseActiveBuffer(std::chrono::nanoseconds ns_late) { |