diff options
author | Eric Laurent <elaurent@google.com> | 2013-11-05 18:22:08 -0800 |
---|---|---|
committer | Eric Laurent <elaurent@google.com> | 2013-11-05 18:22:08 -0800 |
commit | a23f17ac334ff20a11ee63dd177cb1080e44c483 (patch) | |
tree | e15dc095de74afc97fc509aa855cedf010df6c1e /services | |
parent | 5c7ffaed6f04b844c2e4e2024bfb0203ac2233dd (diff) | |
download | frameworks_av-a23f17ac334ff20a11ee63dd177cb1080e44c483.zip frameworks_av-a23f17ac334ff20a11ee63dd177cb1080e44c483.tar.gz frameworks_av-a23f17ac334ff20a11ee63dd177cb1080e44c483.tar.bz2 |
audioflinger: fix direct output underrun
Underruns on tracks handled by a direct or offloaded
threads were not properly reported to the applications
causing a failure to automatically recover.
Bug: 11535001.
Change-Id: I7a8696b4d646f78b16710addfe7c108d0dd0038d
Diffstat (limited to 'services')
-rw-r--r-- | services/audioflinger/Threads.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/services/audioflinger/Threads.cpp b/services/audioflinger/Threads.cpp index b81183c..ba8195e 100644 --- a/services/audioflinger/Threads.cpp +++ b/services/audioflinger/Threads.cpp @@ -3673,6 +3673,9 @@ AudioFlinger::PlaybackThread::mixer_state AudioFlinger::DirectOutputThread::prep if (--(track->mRetryCount) <= 0) { ALOGV("BUFFER TIMEOUT: remove(%d) from active list", track->name()); tracksToRemove->add(track); + // indicate to client process that the track was disabled because of underrun; + // it will then automatically call start() when data is available + android_atomic_or(CBLK_DISABLED, &cblk->mFlags); } else if (last) { mixerStatus = MIXER_TRACKS_ENABLED; } @@ -4094,6 +4097,9 @@ AudioFlinger::PlaybackThread::mixer_state AudioFlinger::OffloadThread::prepareTr ALOGV("OffloadThread: BUFFER TIMEOUT: remove(%d) from active list", track->name()); tracksToRemove->add(track); + // indicate to client process that the track was disabled because of underrun; + // it will then automatically call start() when data is available + android_atomic_or(CBLK_DISABLED, &cblk->mFlags); } else if (last){ mixerStatus = MIXER_TRACKS_ENABLED; } |