mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-29 11:00:29 +00:00
LibAudio: Use an existing file stream when parsing a FLAC header
Before this change the file stream was generated two times: one time in the parse_header(), and another time for the whole class in the constructor. The previous commit moved the m_stream initialization before executing the parse_header function, so we can now reuse that here.
This commit is contained in:
parent
81261bc169
commit
e500b39e47
Notes:
sideshowbarker
2024-07-19 17:20:35 +09:00
Author: https://github.com/krkk Commit: https://github.com/SerenityOS/serenity/commit/e500b39e474 Pull-request: https://github.com/SerenityOS/serenity/pull/9184
1 changed files with 1 additions and 3 deletions
|
@ -69,13 +69,11 @@ bool FlacLoaderPlugin::sniff()
|
|||
|
||||
bool FlacLoaderPlugin::parse_header()
|
||||
{
|
||||
Optional<Core::InputFileStream> fis;
|
||||
bool ok = true;
|
||||
|
||||
InputBitStream bit_input = [&]() -> InputBitStream {
|
||||
if (m_file) {
|
||||
fis = Core::InputFileStream(*m_file);
|
||||
return InputBitStream(*fis);
|
||||
return InputBitStream(m_stream->get<Core::InputFileStream>());
|
||||
}
|
||||
return InputBitStream(m_stream->get<InputMemoryStream>());
|
||||
}();
|
||||
|
|
Loading…
Reference in a new issue