mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2024-11-23 14:25:37 +00:00
AudioStream: Prevent buffering more frames than size
This commit is contained in:
parent
f1d942c2be
commit
47b390e356
|
@ -115,7 +115,7 @@ void AudioStream::BeginWrite(SampleType** buffer_ptr, u32* num_frames)
|
||||||
EnsureBuffer(requested_frames * m_channels);
|
EnsureBuffer(requested_frames * m_channels);
|
||||||
|
|
||||||
*buffer_ptr = m_buffer.GetWritePointer();
|
*buffer_ptr = m_buffer.GetWritePointer();
|
||||||
*num_frames = m_buffer.GetContiguousSpace() / m_channels;
|
*num_frames = std::min(m_buffer_size, m_buffer.GetContiguousSpace() / m_channels);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AudioStream::WriteFrames(const SampleType* frames, u32 num_frames)
|
void AudioStream::WriteFrames(const SampleType* frames, u32 num_frames)
|
||||||
|
|
Loading…
Reference in a new issue