audiotrack_tests: Reduce wait time during playback
In static buffer mode, during playback, the test yields for a
large duration. As the test clips are of small duration, the
playback finishes during this wait. Reduce this wait period
to improve code coverage.
Bug: 254222780
Test: atest audiotrack_tests
Change-Id: I24dfb90b207d0f4017e99112b1b50e322ab3428e
diff --git a/media/libaudioclient/tests/audio_test_utils.cpp b/media/libaudioclient/tests/audio_test_utils.cpp
index 44f0f50..850eb34 100644
--- a/media/libaudioclient/tests/audio_test_utils.cpp
+++ b/media/libaudioclient/tests/audio_test_utils.cpp
@@ -200,7 +200,7 @@
status_t AudioPlayback::waitForConsumption(bool testSeek) {
if (PLAY_STARTED != mState) return INVALID_OPERATION;
// in static buffer mode, lets not play clips with duration > 30 sec
- int retry = 30;
+ int retry = 300;
// Total number of frames in the input file.
size_t totalFrameCount = mMemCapacity / mTrack->frameSize();
while (!mStopPlaying && retry > 0) {
@@ -227,7 +227,7 @@
if (bufferPosition != setPosition) return BAD_VALUE;
mTrack->start();
}
- std::this_thread::sleep_for(std::chrono::milliseconds(300));
+ std::this_thread::sleep_for(std::chrono::milliseconds(100));
retry--;
}
if (!mStopPlaying) return TIMED_OUT;