summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvivek mehta <mvivek@codeaurora.org>2015-09-25 14:07:43 -0700
committervivek mehta <mvivek@codeaurora.org>2015-10-16 10:11:39 -0700
commite238a1ff27c168a32012e00bcdec39dcb3307d85 (patch)
treecc4d65fafbd76e6e96053d01f02c217fa2fb20bd
parentcbd30414a123997a694d486a4b3cb5b3fc06e38f (diff)
downloadandroid_hardware_qcom_audio-e238a1ff27c168a32012e00bcdec39dcb3307d85.tar.gz
android_hardware_qcom_audio-e238a1ff27c168a32012e00bcdec39dcb3307d85.tar.bz2
android_hardware_qcom_audio-e238a1ff27c168a32012e00bcdec39dcb3307d85.zip
hal: check offload_callback not NULL before calling
- in case when offload o/p stream is created in blocking mode flinger do not sets the callback pointer. So check for offload callback pointer before calling. Change-Id: I4192c8cc793c48d7647d7652366c8c92ceb469cc
-rw-r--r--hal/audio_hw.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index 35d26618..69203308 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2013-2015, The Linux Foundation. All rights reserved.
* Not a Contribution.
*
* Copyright (C) 2013 The Android Open Source Project
@@ -1311,7 +1311,7 @@ static void *offload_thread_loop(void *context)
lock_output_stream(out);
out->offload_thread_blocked = false;
pthread_cond_signal(&out->cond);
- if (send_callback) {
+ if (send_callback && out->offload_callback) {
ALOGVV("%s: sending offload_callback event %d", __func__, event);
out->offload_callback(event, NULL, out->offload_cookie);
}