Codec Offload: Add NULL check as mCallbackThread is NULL
when offloaded HAL is running BLOCKING mode
b/14897952
Change-Id: I159a33e1181c1a62d80ab4bd3337a35dafaad884
Signed-off-by: Uday Gupta <guptau@broadcom.com>
Signed-off-by: Pierre Couillaud <pierre@broadcom.com>
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();
}