summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhil Burk <philburk@google.com>2015-05-02 02:31:19 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-05-02 02:31:20 +0000
commit8ce74c3c11458faa34395591a3424e90db856bfc (patch)
treee3e1f5120c35890402528e2959e77be85aaa1bfd
parent8651c6f5069cca40ef805b800a9730617ff7f9b8 (diff)
parent6fc2a7c81f62b1e21487ae37e11aae6241bc3ead (diff)
downloadframeworks_av-8ce74c3c11458faa34395591a3424e90db856bfc.zip
frameworks_av-8ce74c3c11458faa34395591a3424e90db856bfc.tar.gz
frameworks_av-8ce74c3c11458faa34395591a3424e90db856bfc.tar.bz2
Merge "AudioTrack: fix direct tracks not pausing" into mnc-dev
-rw-r--r--services/audioflinger/Threads.cpp17
-rw-r--r--services/audioflinger/Threads.h5
2 files changed, 12 insertions, 10 deletions
diff --git a/services/audioflinger/Threads.cpp b/services/audioflinger/Threads.cpp
index fa00b47..8b8dd78 100644
--- a/services/audioflinger/Threads.cpp
+++ b/services/audioflinger/Threads.cpp
@@ -2051,6 +2051,9 @@ void AudioFlinger::PlaybackThread::readOutputParameters_l()
ALOGW("direct output implements resume but not pause");
}
}
+ if (!mHwSupportsPause && mOutput->flags & AUDIO_OUTPUT_FLAG_HW_AV_SYNC) {
+ LOG_ALWAYS_FATAL("HW_AV_SYNC requested but HAL does not implement pause and resume");
+ }
if (mType == DUPLICATING && mMixerBufferEnabled && mEffectBufferEnabled) {
// For best precision, we use float instead of the associated output
@@ -4371,9 +4374,9 @@ AudioFlinger::PlaybackThread::mixer_state AudioFlinger::DirectOutputThread::prep
sp<Track> l = mLatestActiveTrack.promote();
bool last = l.get() == track;
- if (mHwSupportsPause && track->isPausing()) {
+ if (track->isPausing()) {
track->setPaused();
- if (last && !mHwPaused) {
+ if (mHwSupportsPause && last && !mHwPaused) {
doHwPause = true;
mHwPaused = true;
}
@@ -4383,13 +4386,11 @@ AudioFlinger::PlaybackThread::mixer_state AudioFlinger::DirectOutputThread::prep
if (last) {
flushPending = true;
}
- } else if (mHwSupportsPause && track->isResumePending()){
+ } else if (track->isResumePending()) {
track->resumeAck();
- if (last) {
- if (mHwPaused) {
- doHwResume = true;
- mHwPaused = false;
- }
+ if (last && mHwPaused) {
+ doHwResume = true;
+ mHwPaused = false;
}
}
diff --git a/services/audioflinger/Threads.h b/services/audioflinger/Threads.h
index 066090b..8167bd1 100644
--- a/services/audioflinger/Threads.h
+++ b/services/audioflinger/Threads.h
@@ -712,8 +712,9 @@ protected:
audio_patch_handle_t *handle);
virtual status_t releaseAudioPatch_l(const audio_patch_handle_t handle);
- bool usesHwAvSync() const { return (mType == DIRECT) && (mOutput != NULL) &&
- (mOutput->flags & AUDIO_OUTPUT_FLAG_HW_AV_SYNC); }
+ bool usesHwAvSync() const { return (mType == DIRECT) && (mOutput != NULL)
+ && mHwSupportsPause
+ && (mOutput->flags & AUDIO_OUTPUT_FLAG_HW_AV_SYNC); }
private: