mirror of
https://github.com/SerenityOS/serenity
synced 2024-09-06 17:06:31 +00:00
LibAudio: Fix parsing of WAV files from memory
The WavLoaderPlugin now loads the file header correctly when reading from a ByteBuffer.
This commit is contained in:
parent
228fa1c51d
commit
d0812e9019
|
@ -120,9 +120,12 @@ bool WavLoaderPlugin::parse_header()
|
|||
u8 value;
|
||||
if (m_file) {
|
||||
*file_stream >> value;
|
||||
if (file_stream->handle_read_failure()) {
|
||||
if (file_stream->handle_read_failure())
|
||||
ok = false;
|
||||
} else {
|
||||
*m_stream >> value;
|
||||
if (m_stream->has_any_error())
|
||||
ok = false;
|
||||
}
|
||||
}
|
||||
return value;
|
||||
};
|
||||
|
@ -131,9 +134,12 @@ bool WavLoaderPlugin::parse_header()
|
|||
u16 value;
|
||||
if (m_file) {
|
||||
*file_stream >> value;
|
||||
if (file_stream->handle_read_failure()) {
|
||||
if (file_stream->handle_read_failure())
|
||||
ok = false;
|
||||
} else {
|
||||
*m_stream >> value;
|
||||
if (m_stream->has_any_error())
|
||||
ok = false;
|
||||
}
|
||||
}
|
||||
return value;
|
||||
};
|
||||
|
@ -142,9 +148,12 @@ bool WavLoaderPlugin::parse_header()
|
|||
u32 value;
|
||||
if (m_file) {
|
||||
*file_stream >> value;
|
||||
if (file_stream->handle_read_failure()) {
|
||||
if (file_stream->handle_read_failure())
|
||||
ok = false;
|
||||
} else {
|
||||
*m_stream >> value;
|
||||
if (m_stream->has_any_error())
|
||||
ok = false;
|
||||
}
|
||||
}
|
||||
return value;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue