1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 12:27:35 +00:00

LibVideo: Propagate decoder errors in the Matroska Reader

Matroska::Reader functions now return DecoderErrorOr instead of values
being declared Optional. Useful errors can be handled by the users of
the parser, similarly to the VP9 decoder. A lot of the error checking
in the reader is a lot cleaner thanks to this change, since all reads
can be range checked in Streamer::read_octet() now.

Most functions for the Streamer class are now also out-of-line in
Reader.cpp now instead of residing in the header.
This commit is contained in:
Zaggy1024 2022-11-09 23:38:50 -06:00 committed by Andreas Kling
parent 9cf7e8c5aa
commit 2dfd236dcd
6 changed files with 338 additions and 440 deletions

View file

@ -20,7 +20,7 @@ public:
static DecoderErrorOr<NonnullOwnPtr<MatroskaDemuxer>> from_file(StringView filename);
static DecoderErrorOr<NonnullOwnPtr<MatroskaDemuxer>> from_data(ReadonlyBytes data);
MatroskaDemuxer(NonnullOwnPtr<MatroskaDocument>& document)
MatroskaDemuxer(NonnullOwnPtr<MatroskaDocument>&& document)
: m_document(move(document))
{
}