Skip to content

Commit

Permalink
Add 500 msec tolerance to TTPlayOpusOgg
Browse files Browse the repository at this point in the history
  • Loading branch information
bear101 committed Nov 2, 2024
1 parent 2e043fe commit a936aa5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Library/TeamTalkLib/test/CatchDefault.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3945,6 +3945,7 @@ TEST_CASE("TTPlayOpusOgg")
started = false;
paused = false;
durationMSec = GETTIMESTAMP();
const int pausedurationMSec = 1000;
while (!stop && WaitForEvent(ttclient, CLIENTEVENT_LOCAL_MEDIAFILE, msg, DEFWAIT))
{
switch(msg.mediafileinfo.nStatus)
Expand All @@ -3963,7 +3964,7 @@ TEST_CASE("TTPlayOpusOgg")
case MFS_PAUSED :
REQUIRE(!paused);
paused = true;
WaitForEvent(ttclient, CLIENTEVENT_NONE, msg, 1000);
WaitForEvent(ttclient, CLIENTEVENT_NONE, msg, pausedurationMSec);
mfp.bPaused = FALSE;
REQUIRE(TT_UpdateLocalPlayback(ttclient, session, &mfp));
started = false;
Expand All @@ -3981,7 +3982,8 @@ TEST_CASE("TTPlayOpusOgg")
REQUIRE(paused);
durationMSec = GETTIMESTAMP() - durationMSec;
// precision reduced due to GitHub CI being slow
REQUIRE(int(durationMSec) >= int(mfi.uDurationMSec + 1000));
const int toleranceMSec = 500;
REQUIRE(int(durationMSec) >= int(mfi.uDurationMSec + pausedurationMSec - pausedurationMSec));
}

TEST_CASE("TTPlayFFmpegOpus")
Expand Down

0 comments on commit a936aa5

Please sign in to comment.