mirror of
https://github.com/RGBCube/serenity
synced 2025-06-01 09:18:11 +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
1 changed files with 15 additions and 6 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue