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.
This commit is contained in:
Dean Galvin committed 2026-10-22 03:57:05 +13:00
1 parent cecb540a63
commit f40e1b68c8
1 file changed
+2 -2
+2 -2
View File
@@ -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);