audioflinger: OffloadThread fix for resume underrun
AudioFlinger can miss resuming h/w on a pause->resume transition
if sufficient data isn't available
Bug: 11358524.
Change-Id: Ic3c75256290d3515fd4a96dfcc900909fbe5bc15
diff --git a/services/audioflinger/Tracks.cpp b/services/audioflinger/Tracks.cpp
index c5fa624..9fe459b 100644
--- a/services/audioflinger/Tracks.cpp
+++ b/services/audioflinger/Tracks.cpp
@@ -1020,9 +1020,13 @@
if (mState == RESUMING)
mState = ACTIVE;
+
// Other possibility of pending resume is stopping_1 state
// Do not update the state from stopping as this prevents
- //drain being called.
+ // drain being called.
+ if (mState == STOPPING_1) {
+ mResumeToStopping = false;
+ }
}
// ----------------------------------------------------------------------------