mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 21:08:12 +00:00
LibVideo: Add PlaybackManager::from_mapped_file
This allows us to create a PlaybackManager from a file which has already been mapped, instead of passing a file name. This means that anyone who uses `PlaybackManager` can now use LibFSAC :)
This commit is contained in:
parent
69396d4c4d
commit
465fa3460f
6 changed files with 23 additions and 1 deletions
|
@ -81,8 +81,13 @@ constexpr u32 CUE_REFERENCE_ID = 0xDB;
|
|||
DecoderErrorOr<Reader> Reader::from_file(StringView path)
|
||||
{
|
||||
auto mapped_file = DECODER_TRY(DecoderErrorCategory::IO, Core::MappedFile::map(path));
|
||||
return from_mapped_file(mapped_file);
|
||||
}
|
||||
|
||||
DecoderErrorOr<Reader> Reader::from_mapped_file(NonnullRefPtr<Core::MappedFile> mapped_file)
|
||||
{
|
||||
auto reader = TRY(from_data(mapped_file->bytes()));
|
||||
reader.m_mapped_file = mapped_file;
|
||||
reader.m_mapped_file = move(mapped_file);
|
||||
return reader;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue