Skip to content

Commit

Permalink
Make sure to close frames even though some assert tests fail
Browse files Browse the repository at this point in the history
  • Loading branch information
youennf authored and padenot committed Nov 27, 2023
1 parent 0808db6 commit 13e768d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion webcodecs/full-cycle-test.https.any.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ async function runFullCycleTest(t, options) {
await checkEncoderSupport(t, encoder_config);
let decoder = new VideoDecoder({
output(frame) {
t.add_cleanup(() => { frame.close() });

assert_equals(frame.visibleRect.width, w, "visibleRect.width");
assert_equals(frame.visibleRect.height, h, "visibleRect.height");
assert_equals(frame.timestamp, next_ts++, "decode timestamp");
Expand All @@ -105,7 +107,6 @@ async function runFullCycleTest(t, options) {
frames_decoded++;
assert_true(validateBlackDots(frame, frame.timestamp),
"frame doesn't match. ts: " + frame.timestamp);
frame.close();
},
error(e) {
assert_unreached(e.message);
Expand Down

0 comments on commit 13e768d

Please sign in to comment.