diff options
Diffstat (limited to 'services/audioflinger/FastMixer.cpp')
-rw-r--r-- | services/audioflinger/FastMixer.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/services/audioflinger/FastMixer.cpp b/services/audioflinger/FastMixer.cpp index 04d0f65..cd55396 100644 --- a/services/audioflinger/FastMixer.cpp +++ b/services/audioflinger/FastMixer.cpp @@ -360,20 +360,25 @@ bool FastMixer::threadLoop() // in the overall fast mix cycle being delayed. Should use a non-blocking FIFO. size_t framesReady = fastTrack->mBufferProvider->framesReady(); FastTrackDump *ftDump = &dumpState->mTracks[i]; - uint32_t underruns = ftDump->mUnderruns; + FastTrackUnderruns underruns = ftDump->mUnderruns; if (framesReady < frameCount) { ATRACE_INT("underrun", i); - ftDump->mUnderruns = (underruns + 2) | 1; if (framesReady == 0) { + underruns.mBitFields.mEmpty++; + underruns.mBitFields.mMostRecent = UNDERRUN_EMPTY; mixer->disable(name); } else { // allow mixing partial buffer + underruns.mBitFields.mPartial++; + underruns.mBitFields.mMostRecent = UNDERRUN_PARTIAL; mixer->enable(name); } - } else if (underruns & 1) { - ftDump->mUnderruns = underruns & ~1; + } else { + underruns.mBitFields.mFull++; + underruns.mBitFields.mMostRecent = UNDERRUN_FULL; mixer->enable(name); } + ftDump->mUnderruns = underruns; } // process() is CPU-bound mixer->process(AudioBufferProvider::kInvalidPTS); |