diff options
author | Steve Kondik <steve@cyngn.com> | 2016-03-11 04:19:41 -0800 |
---|---|---|
committer | Steve Kondik <steve@cyngn.com> | 2016-03-11 04:19:41 -0800 |
commit | 3e55a8628681cc32c38d97f11b5e44881d56bc96 (patch) | |
tree | 3159a681d590ebab62f88d7adade509b7bc4537f /post_proc | |
parent | 934773692aedfd455472de69a96fa691e05215ac (diff) | |
parent | 582e0a5e965897ea54ecfa5fe206797dab577a45 (diff) | |
download | hardware_qcom_audio-3e55a8628681cc32c38d97f11b5e44881d56bc96.tar.gz hardware_qcom_audio-3e55a8628681cc32c38d97f11b5e44881d56bc96.tar.bz2 hardware_qcom_audio-3e55a8628681cc32c38d97f11b5e44881d56bc96.zip |
Merge tag 'android-6.0.1_r22' of https://android.googlesource.com/platform/hardware/qcom/audio into cm-13.0
Android 6.0.1 release 22
Diffstat (limited to 'post_proc')
-rw-r--r-- | post_proc/volume_listener.c | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/post_proc/volume_listener.c b/post_proc/volume_listener.c index 34954bbc..ef632993 100644 --- a/post_proc/volume_listener.c +++ b/post_proc/volume_listener.c @@ -688,20 +688,31 @@ static int vol_prc_lib_release(effect_handle_t handle) struct listnode *node, *temp_node_next; vol_listener_context_t *context = NULL; vol_listener_context_t *recv_contex = (vol_listener_context_t *)handle; - int status = -1; + int status = -EINVAL; bool recompute_flag = false; int active_stream_count = 0; + uint32_t session_id; + uint32_t stream_type; + effect_uuid_t uuid; + ALOGV("%s context %p", __func__, handle); + + if (recv_contex == NULL) { + return status; + } pthread_mutex_lock(&vol_listner_init_lock); + session_id = recv_contex->session_id; + stream_type = recv_contex->stream_type; + uuid = recv_contex->desc->uuid; // check if the handle/context provided is valid list_for_each_safe(node, temp_node_next, &vol_effect_list) { context = node_to_item(node, struct vol_listener_context_s, effect_list_node); - if ((memcmp(&(context->desc->uuid), &(recv_contex->desc->uuid), sizeof(effect_uuid_t)) == 0) - && (context->session_id == recv_contex->session_id) - && (context->stream_type == recv_contex->stream_type)) { + if ((memcmp(&(context->desc->uuid), &uuid, sizeof(effect_uuid_t)) == 0) + && (context->session_id == session_id) + && (context->stream_type == stream_type)) { ALOGV("--- Found something to remove ---"); - list_remove(&context->effect_list_node); + list_remove(node); PRINT_STREAM_TYPE(context->stream_type); if (context->dev_id == AUDIO_DEVICE_OUT_SPEAKER) { recompute_flag = true; @@ -715,6 +726,8 @@ static int vol_prc_lib_release(effect_handle_t handle) if (status != 0) { ALOGE("something wrong ... <<<--- Found NOTHING to remove ... ???? --->>>>>"); + pthread_mutex_unlock(&vol_listner_init_lock); + return status; } // if there are no active streams, reset cal and volume level |