mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 02:47:35 +00:00
LibVideo: Allow bit stream reads to throw errors
Errors are propagated to the user of the decoder so that they can be aware of specific places where a read failed.
This commit is contained in:
parent
af0584ea53
commit
b37ea6b414
10 changed files with 529 additions and 509 deletions
|
@ -42,10 +42,12 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
|
||||
auto const& frame = block.frame(0);
|
||||
dbgln("Reading frame 0 from block @ {}", block.timestamp());
|
||||
bool failed = !vp9_decoder.decode_frame(frame);
|
||||
auto result = vp9_decoder.decode_frame(frame);
|
||||
vp9_decoder.dump_frame_info();
|
||||
if (failed)
|
||||
if (result.is_error()) {
|
||||
outln("Error: {}", result.error().string_literal());
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue