From dfd0eb877f69b63a2840396f3398d96b127f38b6 Mon Sep 17 00:00:00 2001 From: Zaggy1024 Date: Thu, 13 Apr 2023 18:51:36 -0500 Subject: [PATCH] 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. --- Tests/LibVideo/TestVP9Decode.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Tests/LibVideo/TestVP9Decode.cpp b/Tests/LibVideo/TestVP9Decode.cpp index 7b2d8ef527..e173f115df 100644 --- a/Tests/LibVideo/TestVP9Decode.cpp +++ b/Tests/LibVideo/TestVP9Decode.cpp @@ -33,6 +33,15 @@ static void decode_video(StringView path, size_t expected_frame_count) auto block = block_result.release_value(); for (auto const& frame : block.frames()) { 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++; } }