From 6fc2a7c81f62b1e21487ae37e11aae6241bc3ead Mon Sep 17 00:00:00 2001 From: Phil Burk Date: Thu, 30 Apr 2015 16:08:10 -0700 Subject: AudioTrack: fix direct tracks not pausing When a Direct Track is paused and the HAL does not support pause() and resume() then the HW never gets paused. The app can just keep writing data, which gets played. Bug: 18899620 Change-Id: Ice0f360956ff7ca425f6f24a0a2a8640d8b43fa8 Signed-off-by: Phil Burk --- services/audioflinger/Threads.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'services/audioflinger/Threads.h') diff --git a/services/audioflinger/Threads.h b/services/audioflinger/Threads.h index 2c514f8..3898532 100644 --- a/services/audioflinger/Threads.h +++ b/services/audioflinger/Threads.h @@ -713,8 +713,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: -- cgit v1.1