mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 20:17:44 +00:00
LibAudio: Pass raw streams to MP3 synchronize()
and read_frame()
`synchronize()` can be simplified greatly by checking whole bytes with bitwise operations, and doing so also avoids the overhead of reading individual bits from a bitstream. Making `read_frame()` also take a `SeekableStream` will allow it to be used inside `synchronize()` in the next commit.
This commit is contained in:
parent
1847155b12
commit
cbdf49de30
2 changed files with 47 additions and 52 deletions
|
@ -42,8 +42,8 @@ public:
|
|||
private:
|
||||
MaybeLoaderError initialize();
|
||||
static MaybeLoaderError skip_id3(SeekableStream& stream);
|
||||
static MaybeLoaderError synchronize(BigEndianInputBitStream& stream, size_t sample_index);
|
||||
static ErrorOr<MP3::Header, LoaderError> read_header(BigEndianInputBitStream& stream, size_t sample_index);
|
||||
static MaybeLoaderError synchronize(SeekableStream& stream, size_t sample_index);
|
||||
static ErrorOr<MP3::Header, LoaderError> read_header(SeekableStream& stream, size_t sample_index);
|
||||
MaybeLoaderError synchronize();
|
||||
MaybeLoaderError build_seek_table();
|
||||
ErrorOr<MP3::MP3Frame, LoaderError> read_next_frame();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue