Loading media/libmedia/AudioTrack.cpp +1 −2 Original line number Diff line number Diff line Loading @@ -742,8 +742,7 @@ status_t AudioTrack::setLoop(uint32_t loopStart, uint32_t loopEnd, int loopCount void AudioTrack::setLoop_l(uint32_t loopStart, uint32_t loopEnd, int loopCount) { // FIXME If setting a loop also sets position to start of loop, then // this is correct. Otherwise it should be removed. // Setting the loop will reset next notification update period (like setPosition). mNewPosition = updateAndGetPosition_l() + mUpdatePeriod; mLoopPeriod = loopCount != 0 ? loopEnd - loopStart : 0; mStaticProxy->setLoop(loopStart, loopEnd, loopCount); Loading media/libmedia/AudioTrackShared.cpp +8 −2 Original line number Diff line number Diff line Loading @@ -503,7 +503,11 @@ void StaticAudioTrackClientProxy::setLoop(size_t loopStart, size_t loopEnd, int newState.mLoopStart = (uint32_t) loopStart; newState.mLoopEnd = (uint32_t) loopEnd; newState.mLoopCount = loopCount; mBufferPosition = loopStart; size_t bufferPosition; if (loopCount == 0 || (bufferPosition = getBufferPosition()) >= loopEnd) { bufferPosition = loopStart; } mBufferPosition = bufferPosition; // snapshot buffer position until loop is acknowledged. (void) mMutator.push(newState); } Loading Loading @@ -776,7 +780,9 @@ ssize_t StaticAudioTrackServerProxy::pollPosition() } else if (state.mLoopCount >= -1) { if (loopStart < loopEnd && loopEnd <= mFrameCount && loopEnd - loopStart >= MIN_LOOP) { if (!(loopStart <= position && position < loopEnd)) { // If the current position is greater than the end of the loop // we "wrap" to the loop start. This might cause an audible pop. if (position >= loopEnd) { mPosition = position = loopStart; } if (state.mLoopCount == -1) { Loading Loading
media/libmedia/AudioTrack.cpp +1 −2 Original line number Diff line number Diff line Loading @@ -742,8 +742,7 @@ status_t AudioTrack::setLoop(uint32_t loopStart, uint32_t loopEnd, int loopCount void AudioTrack::setLoop_l(uint32_t loopStart, uint32_t loopEnd, int loopCount) { // FIXME If setting a loop also sets position to start of loop, then // this is correct. Otherwise it should be removed. // Setting the loop will reset next notification update period (like setPosition). mNewPosition = updateAndGetPosition_l() + mUpdatePeriod; mLoopPeriod = loopCount != 0 ? loopEnd - loopStart : 0; mStaticProxy->setLoop(loopStart, loopEnd, loopCount); Loading
media/libmedia/AudioTrackShared.cpp +8 −2 Original line number Diff line number Diff line Loading @@ -503,7 +503,11 @@ void StaticAudioTrackClientProxy::setLoop(size_t loopStart, size_t loopEnd, int newState.mLoopStart = (uint32_t) loopStart; newState.mLoopEnd = (uint32_t) loopEnd; newState.mLoopCount = loopCount; mBufferPosition = loopStart; size_t bufferPosition; if (loopCount == 0 || (bufferPosition = getBufferPosition()) >= loopEnd) { bufferPosition = loopStart; } mBufferPosition = bufferPosition; // snapshot buffer position until loop is acknowledged. (void) mMutator.push(newState); } Loading Loading @@ -776,7 +780,9 @@ ssize_t StaticAudioTrackServerProxy::pollPosition() } else if (state.mLoopCount >= -1) { if (loopStart < loopEnd && loopEnd <= mFrameCount && loopEnd - loopStart >= MIN_LOOP) { if (!(loopStart <= position && position < loopEnd)) { // If the current position is greater than the end of the loop // we "wrap" to the loop start. This might cause an audible pop. if (position >= loopEnd) { mPosition = position = loopStart; } if (state.mLoopCount == -1) { Loading