diff options
author | Andy Hung <hunga@google.com> | 2015-09-03 16:38:38 -0700 |
---|---|---|
committer | Glenn Kasten <gkasten@google.com> | 2015-10-13 15:48:19 -0700 |
commit | 39609a0a6d95d003b0f237e6c139b070b4df7071 (patch) | |
tree | 587a8b63f59c4293f932b61a0ff24aeac4bbb5dd /media | |
parent | e5200ea76c5d180b53087ae7825326ec61cc4687 (diff) | |
download | frameworks_av-39609a0a6d95d003b0f237e6c139b070b4df7071.zip frameworks_av-39609a0a6d95d003b0f237e6c139b070b4df7071.tar.gz frameworks_av-39609a0a6d95d003b0f237e6c139b070b4df7071.tar.bz2 |
AudioTrack: Skip callback EVENT_STREAM_END on DEAD_OBJECT.
Send only EVENT_NEW_IAUDIOTRACK to initiate teardown.
Bug: 23750452
Change-Id: Ib5dcd578b5b6a6a1d91a03e58ef8da0acd994243
Diffstat (limited to 'media')
-rw-r--r-- | media/libmedia/AudioTrack.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/media/libmedia/AudioTrack.cpp b/media/libmedia/AudioTrack.cpp index ab3d66a..d17f7ae 100644 --- a/media/libmedia/AudioTrack.cpp +++ b/media/libmedia/AudioTrack.cpp @@ -1852,7 +1852,11 @@ nsecs_t AudioTrack::processAudioBuffer() case NO_ERROR: case DEAD_OBJECT: case TIMED_OUT: - mCbf(EVENT_STREAM_END, mUserData, NULL); + if (status != DEAD_OBJECT) { + // for DEAD_OBJECT, we do not send a EVENT_STREAM_END after stop(); + // instead, the application should handle the EVENT_NEW_IAUDIOTRACK. + mCbf(EVENT_STREAM_END, mUserData, NULL); + } { AutoMutex lock(mLock); // The previously assigned value of waitStreamEnd is no longer valid, |