mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 21:37:35 +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
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…
Add table
Add a link
Reference in a new issue