summaryrefslogtreecommitdiffstats
path: root/services/audioflinger/Tracks.cpp
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2013-09-19 14:37:46 -0700
committerEric Laurent <elaurent@google.com>2013-09-19 15:53:20 -0700
commitede6c3b8b1147bc425f7b923882f559a513fe23b (patch)
treeac3986f0521aa4a5af705299ab423ec9d5e98bfa /services/audioflinger/Tracks.cpp
parent5baf2af52cd186633b7173196c1e4a4cd3435f22 (diff)
downloadframeworks_av-ede6c3b8b1147bc425f7b923882f559a513fe23b.zip
frameworks_av-ede6c3b8b1147bc425f7b923882f559a513fe23b.tar.gz
frameworks_av-ede6c3b8b1147bc425f7b923882f559a513fe23b.tar.bz2
audioflinger: fix lost offload thread resume event
It was possible that a resume request signaled by addTrack_l() while waiting for an async write callback is lost. This is because mSignalPending was not set and waitingAsyncCallback_l() would pause the thread loop before executing prepareTracks_l(). The fix consists in using signal_l() method to wake the thread loop o that mSignalPending is set. Also make sure that sleepTime is reset to 0 when resuming to make sure that we write any remaining bytes to the HAL. Bug: 10810347. Change-Id: If9a3b22cc3b9e6eb384a56c48c40e6258d0896ad
Diffstat (limited to 'services/audioflinger/Tracks.cpp')
-rw-r--r--services/audioflinger/Tracks.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/services/audioflinger/Tracks.cpp b/services/audioflinger/Tracks.cpp
index 57aad1e..2b8f0ab 100644
--- a/services/audioflinger/Tracks.cpp
+++ b/services/audioflinger/Tracks.cpp
@@ -651,7 +651,7 @@ void AudioFlinger::PlaybackThread::Track::pause()
case RESUMING:
mState = PAUSING;
ALOGV("ACTIVE/RESUMING => PAUSING (%d) on thread %p", mName, thread.get());
- playbackThread->signal_l();
+ playbackThread->broadcast_l();
break;
default:
@@ -711,7 +711,7 @@ void AudioFlinger::PlaybackThread::Track::flush()
// before mixer thread can run. This is important when offloading
// because the hardware buffer could hold a large amount of audio
playbackThread->flushOutput_l();
- playbackThread->signal_l();
+ playbackThread->broadcast_l();
}
}