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

Commit a6027112 authored by jin.seong's avatar jin.seong Committed by Steve Kondik
Browse files

Remove potential cause of underrun.



1. This part of ProcessAudioBuffer function can make underrun issue.
   Because AudioTrackThread::threadLoop's default case is 'pauseInternal'.

2. Without removed part : If AudioTrack obtain small buffer, then it can request small decoded data to player service without waiting.

3. We already have 'waiting codes' in 'AudioTrackshared.cpp ClientProxy::obtainBuffer', it using '__futex_syscall'.
   If we got 'full shared buffer', then 'ClientProxy::obtainBuffer' waits 'ServerProxy::releaseBuffer'.
   It means, there are duplicated 'waiting codes' for ProcessAudioBuffer.

So I removed this part for preventing underrun issue.

Change-Id: Idcca686054d92a4d123873b78b3b9c2e87d3bdca
Signed-off-by: default avatarJinhyuk Seong <jin.seong@lge.com>
parent 9f182352
Loading
Loading
Loading
Loading
+0 −10
Original line number Original line Diff line number Diff line
@@ -1965,16 +1965,6 @@ nsecs_t AudioTrack::processAudioBuffer()
            return NS_NEVER;
            return NS_NEVER;
        }
        }


        if (mRetryOnPartialBuffer && !isOffloaded()) {
            mRetryOnPartialBuffer = false;
            if (avail < mRemainingFrames) {
                int64_t myns = ((mRemainingFrames - avail) * 1100000000LL) / sampleRate;
                if (ns < 0 || myns < ns) {
                    ns = myns;
                }
                return ns;
            }
        }


        // Divide buffer size by 2 to take into account the expansion
        // Divide buffer size by 2 to take into account the expansion
        // due to 8 to 16 bit conversion: the callback must fill only half
        // due to 8 to 16 bit conversion: the callback must fill only half