diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-07-27 15:28:08 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-07-27 15:29:12 +0200 |
commit | be1025c03f6f67898a4a3aeadbb4db6e32694fff (patch) | |
tree | 230f43845480eb206c0a4c919779d5fa1e5bf221 /Libraries | |
parent | 6f397e23f1ec63aa96521d81fc7c7aea75b0e274 (diff) | |
download | serenity-be1025c03f6f67898a4a3aeadbb4db6e32694fff.zip |
LibAudio: Use ByteBuffer::slice_view() to avoid double memory usage.
We only need a temporary copy for passing to ABuffer::from_pcm_data().
Diffstat (limited to 'Libraries')
-rw-r--r-- | Libraries/LibAudio/AWavLoader.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Libraries/LibAudio/AWavLoader.cpp b/Libraries/LibAudio/AWavLoader.cpp index 6222401cc5..3c17f719c5 100644 --- a/Libraries/LibAudio/AWavLoader.cpp +++ b/Libraries/LibAudio/AWavLoader.cpp @@ -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); |