diff options
author | Divya Narayanan Poojary <dnaray@codeaurora.org> | 2016-03-11 16:55:13 +0530 |
---|---|---|
committer | Arne Coucheron <arco68@gmail.com> | 2017-02-26 06:09:44 +0100 |
commit | 51d45fad25a0f63ab6102b06d230cafc23e0b2a5 (patch) | |
tree | e36c1f7cf500eb0f417b5e24e1a33e2dd1961799 | |
parent | fb55c27bb2a1853e3cd2a511025dc08138e6776e (diff) | |
download | hardware_qcom_audio-51d45fad25a0f63ab6102b06d230cafc23e0b2a5.tar.gz hardware_qcom_audio-51d45fad25a0f63ab6102b06d230cafc23e0b2a5.tar.bz2 hardware_qcom_audio-51d45fad25a0f63ab6102b06d230cafc23e0b2a5.zip |
audio: acquire lock for compress voip close input/output stream
compress voip close input/output function is making call
to same api "voip_call_stop()" which will close both Rx
and Tx path. Now mmap->status for both pcm devices will
be NULL. Meantime if any call to pcm_get_htimestamp()"
will lead to crash
Change-Id: Icd6953265d791b26b180744721ddb61bd33933aa
CRs-fixed: 988730
-rw-r--r-- | hal/audio_hw.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/hal/audio_hw.c b/hal/audio_hw.c index cc5fd5ad..f309360f 100644 --- a/hal/audio_hw.c +++ b/hal/audio_hw.c @@ -2838,9 +2838,11 @@ static void adev_close_output_stream(struct audio_hw_device *dev __unused, ALOGD("%s: enter:stream_handle(%p)",__func__, out); if (out->usecase == USECASE_COMPRESS_VOIP_CALL) { + pthread_mutex_lock(&out->lock); pthread_mutex_lock(&adev->lock); ret = voice_extn_compress_voip_close_output_stream(&stream->common); pthread_mutex_unlock(&adev->lock); + pthread_mutex_unlock(&out->lock); if(ret != 0) ALOGE("%s: Compress voip output cannot be closed, error:%d", __func__, ret); @@ -3244,9 +3246,11 @@ static void adev_close_input_stream(struct audio_hw_device *dev __unused, ALOGD("%s: enter:stream_handle(%p)",__func__, in); if (in->usecase == USECASE_COMPRESS_VOIP_CALL) { + pthread_mutex_lock(&in->lock); pthread_mutex_lock(&adev->lock); ret = voice_extn_compress_voip_close_input_stream(&stream->common); pthread_mutex_unlock(&adev->lock); + pthread_mutex_unlock(&in->lock); if (ret != 0) ALOGE("%s: Compress voip input cannot be closed, error:%d", __func__, ret); |