LibAudio: Update stream APIs used when reading audio metadata
This commit is contained in:
parent
68447d8f39
commit
6070875564
Notes:
sideshowbarker
2024-07-18 05:01:22 +09:00
Author: https://github.com/trflynn89 Commit: https://github.com/SerenityOS/serenity/commit/6070875564 Pull-request: https://github.com/SerenityOS/serenity/pull/17839
1 changed files with 2 additions and 2 deletions
|
@ -100,7 +100,7 @@ ErrorOr<Metadata, LoaderError> load_vorbis_comment(ByteBuffer const& vorbis_comm
|
|||
auto vendor_length = TRY(stream.read_value<LittleEndian<u32>>());
|
||||
Vector<u8> raw_vendor_string;
|
||||
TRY(raw_vendor_string.try_resize(vendor_length));
|
||||
TRY(stream.read_entire_buffer(raw_vendor_string));
|
||||
TRY(stream.read_until_filled(raw_vendor_string));
|
||||
auto vendor_string = TRY(String::from_utf8(StringView { raw_vendor_string.span() }));
|
||||
|
||||
Metadata metadata;
|
||||
|
@ -111,7 +111,7 @@ ErrorOr<Metadata, LoaderError> load_vorbis_comment(ByteBuffer const& vorbis_comm
|
|||
auto user_comment_length = TRY(stream.read_value<LittleEndian<u32>>());
|
||||
Vector<u8> raw_user_comment;
|
||||
TRY(raw_user_comment.try_resize(user_comment_length));
|
||||
TRY(stream.read_entire_buffer(raw_user_comment));
|
||||
TRY(stream.read_until_filled(raw_user_comment));
|
||||
auto unparsed_user_comment = TRY(String::from_utf8(StringView { raw_user_comment.span() }));
|
||||
TRY(read_vorbis_field(metadata, unparsed_user_comment));
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue