mirror of
https://github.com/yuzu-emu/yuzu-android.git
synced 2025-06-13 15:58:44 -05:00
device_session: Pass arguments by const-ref in relevant functions
These functions don't modify the passed in audio buffers, so we can signify that in the interface.
This commit is contained in:
@ -73,7 +73,7 @@ void DeviceSession::Stop() {
|
||||
}
|
||||
}
|
||||
|
||||
void DeviceSession::AppendBuffers(std::span<AudioBuffer> buffers) const {
|
||||
void DeviceSession::AppendBuffers(std::span<const AudioBuffer> buffers) const {
|
||||
for (size_t i = 0; i < buffers.size(); i++) {
|
||||
Sink::SinkBuffer new_buffer{
|
||||
.frames = buffers[i].size / (channel_count * sizeof(s16)),
|
||||
@ -93,14 +93,14 @@ void DeviceSession::AppendBuffers(std::span<AudioBuffer> buffers) const {
|
||||
}
|
||||
}
|
||||
|
||||
void DeviceSession::ReleaseBuffer(AudioBuffer& buffer) const {
|
||||
void DeviceSession::ReleaseBuffer(const AudioBuffer& buffer) const {
|
||||
if (type == Sink::StreamType::In) {
|
||||
auto samples{stream->ReleaseBuffer(buffer.size / sizeof(s16))};
|
||||
system.Memory().WriteBlockUnsafe(buffer.samples, samples.data(), buffer.size);
|
||||
}
|
||||
}
|
||||
|
||||
bool DeviceSession::IsBufferConsumed(AudioBuffer& buffer) const {
|
||||
bool DeviceSession::IsBufferConsumed(const AudioBuffer& buffer) const {
|
||||
return played_sample_count >= buffer.end_timestamp;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user