Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bf96e082 authored by Ram Mohan's avatar Ram Mohan
Browse files

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
parent 53e5651e
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -200,7 +200,7 @@ status_t AudioPlayback::fillBuffer() {
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 @@ status_t AudioPlayback::waitForConsumption(bool testSeek) {
            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;