mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 00:07:36 +00:00
TestVP9Decode: Dequeue frames from the decoder after sending a sample
Frames must be dequeued from the decoder, or the queue will grow continuously until OOM.
This commit is contained in:
parent
e1b3f9a26e
commit
dfd0eb877f
1 changed files with 9 additions and 0 deletions
|
@ -33,6 +33,15 @@ static void decode_video(StringView path, size_t expected_frame_count)
|
||||||
auto block = block_result.release_value();
|
auto block = block_result.release_value();
|
||||||
for (auto const& frame : block.frames()) {
|
for (auto const& frame : block.frames()) {
|
||||||
MUST(vp9_decoder.receive_sample(frame));
|
MUST(vp9_decoder.receive_sample(frame));
|
||||||
|
while (true) {
|
||||||
|
auto frame_result = vp9_decoder.get_decoded_frame();
|
||||||
|
if (frame_result.is_error()) {
|
||||||
|
if (frame_result.error().category() == Video::DecoderErrorCategory::NeedsMoreInput) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
VERIFY_NOT_REACHED();
|
||||||
|
}
|
||||||
|
}
|
||||||
frame_count++;
|
frame_count++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue