summaryrefslogtreecommitdiffstats
path: root/media/libmedia
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2014-10-07 15:45:14 -0700
committerEric Laurent <elaurent@google.com>2014-10-07 15:45:14 -0700
commit7985dcb06e0c29d5cc12d0c0e17e03d5d863cf53 (patch)
treee99ab2f03b3fb49d533b8cf5e8659b39f5e5d8c8 /media/libmedia
parentf0011d49c0f08753dc2dc254c5a70885a9986602 (diff)
downloadframeworks_av-7985dcb06e0c29d5cc12d0c0e17e03d5d863cf53.zip
frameworks_av-7985dcb06e0c29d5cc12d0c0e17e03d5d863cf53.tar.gz
frameworks_av-7985dcb06e0c29d5cc12d0c0e17e03d5d863cf53.tar.bz2
AudioTrack: fix AudioTrackThread crash upon exit
In case of error during createTrack_l(), there is a possibility that a newly created AudioTrackThread is resumed by requestExit() just after entering the Thread class _threadLoop() but before entering the class threadLoop(). In this case, processAudioBuffer() is executed once with mCblk == 0 and we assert. Bug: 17894033. Change-Id: I93d0d0d4dbf14bcb88dad23e6ad49d2ecd47badd
Diffstat (limited to 'media/libmedia')
-rw-r--r--media/libmedia/AudioTrack.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/media/libmedia/AudioTrack.cpp b/media/libmedia/AudioTrack.cpp
index e3beba5..8e0704f 100644
--- a/media/libmedia/AudioTrack.cpp
+++ b/media/libmedia/AudioTrack.cpp
@@ -2244,6 +2244,9 @@ bool AudioTrack::AudioTrackThread::threadLoop()
return true;
}
}
+ if (exitPending()) {
+ return false;
+ }
nsecs_t ns = mReceiver.processAudioBuffer();
switch (ns) {
case 0: