From 0248a2a3ae176e4f306dbf3d869792bb93312ed5 Mon Sep 17 00:00:00 2001 From: Jean-Michel Trivi Date: Wed, 21 Nov 2018 10:05:57 -0800 Subject: [PATCH] Fix double track thread initialization Bug: 119870459 Test: cts-tradefed run cts -m CtsMediaTestCases -t android.media.cts.AudioTrackOffloadTest Change-Id: I15f314ee5696ead90a09991bfe10e1ae3ff013e0 --- media/libaudioclient/AudioTrack.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/media/libaudioclient/AudioTrack.cpp b/media/libaudioclient/AudioTrack.cpp index 96fccaee88..df9aea67eb 100644 --- a/media/libaudioclient/AudioTrack.cpp +++ b/media/libaudioclient/AudioTrack.cpp @@ -811,12 +811,9 @@ void AudioTrack::stop() if (!isOffloaded_l()) { t->pause(); } else if (mTransfer == TRANSFER_SYNC_NOTIF_CALLBACK) { - const sp t = mAudioTrackThread; - if (t != 0) { - // causes wake up of the playback thread, that will callback the client for - // EVENT_STREAM_END in processAudioBuffer() - t->wake(); - } + // causes wake up of the playback thread, that will callback the client for + // EVENT_STREAM_END in processAudioBuffer() + t->wake(); } } else { setpriority(PRIO_PROCESS, 0, mPreviousPriority);