1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 22:57:44 +00:00

LibAudio: Remove the last occurrence of Core::File in the Flac plugin

The design is deeply inspired from what is done in the Wav plugin.
This commit is contained in:
Lucas CHOLLET 2022-10-13 12:13:15 +02:00 committed by Linus Groh
parent f028930033
commit 597a614ce6
2 changed files with 8 additions and 20 deletions

View file

@ -95,8 +95,7 @@ private:
ALWAYS_INLINE ErrorOr<u32, LoaderError> convert_sample_rate_code(u8 sample_rate_code);
ALWAYS_INLINE ErrorOr<PcmSampleFormat, LoaderError> convert_bit_depth_code(u8 bit_depth_code);
RefPtr<Core::File> m_file;
Optional<LoaderError> m_error {};
StringView m_path;
// Data obtained directly from the FLAC metadata: many values have specific bit counts
u32 m_sample_rate { 0 }; // 20 bit
@ -115,6 +114,7 @@ private:
// keep track of the start of the data in the FLAC stream to seek back more easily
u64 m_data_start_location { 0 };
OwnPtr<Core::Stream::SeekableStream> m_stream;
Optional<Bytes> m_backing_memory;
Optional<FlacFrameHeader> m_current_frame;
// Whatever the last get_more_samples() call couldn't return gets stored here.
Vector<Sample, FLAC_BUFFER_SIZE> m_unread_data;