Merge "AudioTrack: fix AudioTrackThread crash upon exit" into lmp-dev
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 @@
             return true;
         }
     }
+    if (exitPending()) {
+        return false;
+    }
     nsecs_t ns = mReceiver.processAudioBuffer();
     switch (ns) {
     case 0: