summaryrefslogtreecommitdiffstats
path: root/services/audioflinger/Threads.h
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2013-10-17 18:59:26 -0700
committerEric Laurent <elaurent@google.com>2013-10-17 18:59:26 -0700
commit6a51d7ed7062536ccc892c8850a34ed55cbc8d5c (patch)
tree95746546a67c27a04a0e5bd82f9760d80ad5f0d9 /services/audioflinger/Threads.h
parentdedc7b0fa23c21b525dc8abb572bb8161ad66a9b (diff)
downloadframeworks_av-6a51d7ed7062536ccc892c8850a34ed55cbc8d5c.zip
frameworks_av-6a51d7ed7062536ccc892c8850a34ed55cbc8d5c.tar.gz
frameworks_av-6a51d7ed7062536ccc892c8850a34ed55cbc8d5c.tar.bz2
audioflinger: fix track terminated before playing
When a track is terminated before any audio was written, we should not send a drain request to the HAL. The drain will be ignored and we will wait the async callback for ever. Also fix a potential deadlock by not deleting a track with the thread mutex held: mPreviousTrack changed from a sp to a raw pointer. Bug: 11247103. Change-Id: I0a4b47b099204c7c326d45d700234ab8f72d8eae
Diffstat (limited to 'services/audioflinger/Threads.h')
-rw-r--r--services/audioflinger/Threads.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/services/audioflinger/Threads.h b/services/audioflinger/Threads.h
index 802b784..a5d2169 100644
--- a/services/audioflinger/Threads.h
+++ b/services/audioflinger/Threads.h
@@ -735,7 +735,7 @@ public:
OffloadThread(const sp<AudioFlinger>& audioFlinger, AudioStreamOut* output,
audio_io_handle_t id, uint32_t device);
- virtual ~OffloadThread();
+ virtual ~OffloadThread() {};
protected:
// threadLoop snippets
@@ -755,7 +755,7 @@ private:
bool mFlushPending;
size_t mPausedWriteLength; // length in bytes of write interrupted by pause
size_t mPausedBytesRemaining; // bytes still waiting in mixbuffer after resume
- sp<Track> mPreviousTrack; // used to detect track switch
+ Track *mPreviousTrack; // used to detect track switch
};
class AsyncCallbackThread : public Thread {