mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-20 11:36:10 +00:00
LibAudio: Use ByteBuffer::slice_view() to avoid double memory usage.
We only need a temporary copy for passing to ABuffer::from_pcm_data().
This commit is contained in:
parent
6f397e23f1
commit
be1025c03f
Notes:
sideshowbarker
2024-07-19 13:01:43 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/be1025c03f6
1 changed files with 1 additions and 1 deletions
|
@ -126,7 +126,7 @@ RefPtr<ABuffer> AWavLoader::parse_wav(ByteBuffer& buffer)
|
|||
// Just make sure we're good before we read the data...
|
||||
ASSERT(!stream.handle_read_failure());
|
||||
|
||||
auto sample_data = buffer.slice(stream.offset(), data_sz);
|
||||
auto sample_data = buffer.slice_view(stream.offset(), data_sz);
|
||||
|
||||
dbgprintf("Read WAV of format PCM with num_channels %d sample rate %d, bits per sample %d\n", num_channels, sample_rate, bits_per_sample);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue