Merge "Codec Offload: Add NULL check as mCallbackThread is NULL when offloaded HAL is running BLOCKING mode"
diff --git a/services/audioflinger/Threads.cpp b/services/audioflinger/Threads.cpp
index 1da5147..69a1883 100644
--- a/services/audioflinger/Threads.cpp
+++ b/services/audioflinger/Threads.cpp
@@ -3951,7 +3951,10 @@
mMixerStatus = MIXER_DRAIN_ALL;
threadLoop_drain();
}
- mCallbackThread->exit();
+ if (mUseAsyncWrite) {
+ ALOG_ASSERT(mCallbackThread != 0);
+ mCallbackThread->exit();
+ }
PlaybackThread::threadLoop_exit();
}