From f40e1b68c88bec2007ceeaef67742902f2deae87 Mon Sep 17 00:00:00 2001 From: Dean Galvin Date: Thu, 22 Oct 2026 03:57:05 +1300 Subject: [PATCH] test(avplayer): wait for the frame in the sync tolerance check The sync tolerance test asked for the next frame once, without waiting, so on a loaded runner a decoder that had not queued frame 1 yet failed the delivery check, and the premature-delivery check passed for the same reason. Poll for the frame in both checks: with a bounded wait for the premature case and the usual wait for delivery. --- core/libs/tests/GuestAvPlayer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/libs/tests/GuestAvPlayer.cpp b/core/libs/tests/GuestAvPlayer.cpp index efa5ff1e00..68ef734c2f 100644 --- a/core/libs/tests/GuestAvPlayer.cpp +++ b/core/libs/tests/GuestAvPlayer.cpp @@ -1596,9 +1596,9 @@ void TestVideoSyncTolerance() { Check(WaitFor([&] { return sceAvPlayerGetVideoDataEx(player, &frame) != 0; }), "sync tolerance first frame missing"); Check(FrameIndex(frame.timestamp) == 0, "first frame not index 0"); AvPlayer::SetAvPlayerClockForTest_nid_no_patch(player, 5.0); - Check(!sceAvPlayerGetVideoDataEx(player, &frame), "frame beyond sync tolerance delivered prematurely"); + Check(!WaitFor([&] { return sceAvPlayerGetVideoDataEx(player, &frame) != 0; }, 200), "frame beyond sync tolerance delivered prematurely"); AvPlayer::SetAvPlayerClockForTest_nid_no_patch(player, 10.0); - Check(sceAvPlayerGetVideoDataEx(player, &frame), "frame within sync tolerance was not delivered"); + Check(WaitFor([&] { return sceAvPlayerGetVideoDataEx(player, &frame) != 0; }), "frame within sync tolerance was not delivered"); Check(FrameIndex(frame.timestamp) == 1, "unexpected second frame index"); Check(sceAvPlayerClose(player) == 0, "sync tolerance close failed"); std::lock_guard lock(allocations.mutex);