mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 23:07:35 +00:00
AK: Rename Stream::read_entire_buffer to Stream::read_until_filled
No functional changes.
This commit is contained in:
parent
d5871f5717
commit
a3f73e7d85
31 changed files with 58 additions and 58 deletions
|
@ -93,7 +93,7 @@ template<typename T>
|
|||
static ErrorOr<double> read_sample(Stream& stream)
|
||||
{
|
||||
T sample { 0 };
|
||||
TRY(stream.read_entire_buffer(Bytes { &sample, sizeof(T) }));
|
||||
TRY(stream.read_until_filled(Bytes { &sample, sizeof(T) }));
|
||||
// Remap integer samples to normalized floating-point range of -1 to 1.
|
||||
if constexpr (IsIntegral<T>) {
|
||||
if constexpr (NumericLimits<T>::is_signed()) {
|
||||
|
@ -157,7 +157,7 @@ ErrorOr<Vector<FixedArray<Sample>>, LoaderError> WavLoaderPlugin::load_chunks(si
|
|||
pcm_bits_per_sample(m_sample_format), sample_format_name(m_sample_format));
|
||||
|
||||
auto sample_data = LOADER_TRY(ByteBuffer::create_zeroed(bytes_to_read));
|
||||
LOADER_TRY(m_stream->read_entire_buffer(sample_data.bytes()));
|
||||
LOADER_TRY(m_stream->read_until_filled(sample_data.bytes()));
|
||||
|
||||
// m_loaded_samples should contain the amount of actually loaded samples
|
||||
m_loaded_samples += samples_to_read;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue