summaryrefslogtreecommitdiff
path: root/Tests/LibVideo
diff options
context:
space:
mode:
authorZaggy1024 <zaggy1024@gmail.com>2022-11-09 23:38:50 -0600
committerAndreas Kling <kling@serenityos.org>2022-11-25 23:28:39 +0100
commit2dfd236dcd96f40b59aaba91cce16c3b8740efbc (patch)
tree9701bfd6bcc71157e0d9a5583f88236d6d1a020d /Tests/LibVideo
parent9cf7e8c5aafe23de2a6284a4a74d26089cb04fcb (diff)
downloadserenity-2dfd236dcd96f40b59aaba91cce16c3b8740efbc.zip
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.
Diffstat (limited to 'Tests/LibVideo')
-rw-r--r--Tests/LibVideo/TestVP9Decode.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/Tests/LibVideo/TestVP9Decode.cpp b/Tests/LibVideo/TestVP9Decode.cpp
index c1c008e327..ffcea9539b 100644
--- a/Tests/LibVideo/TestVP9Decode.cpp
+++ b/Tests/LibVideo/TestVP9Decode.cpp
@@ -11,8 +11,7 @@
static void decode_video(StringView path, size_t expected_frame_count)
{
- auto matroska_document = Video::Matroska::Reader::parse_matroska_from_file(path);
- VERIFY(matroska_document);
+ auto matroska_document = MUST(Video::Matroska::Reader::parse_matroska_from_file(path));
auto video_track_optional = matroska_document->track_for_track_type(Video::Matroska::TrackEntry::TrackType::Video);
VERIFY(video_track_optional.has_value());
auto video_track_entry = video_track_optional.value();