post_proc: explicitly disable virtualizer module if strength is 0
0 stength in DSP virtualizer is not equivalent to disable state as down
mix is still happening for multichannel inputs.
For better user experience, explicitly disable virtualizer module when
strength is 0.
Change-Id: Ic2884ac7010e4f835df871719d546c0c05173f4b
CRs-Fixed: 872772
diff --git a/post_proc/virtualizer.c b/post_proc/virtualizer.c
index 2748568..3874f0b 100644
--- a/post_proc/virtualizer.c
+++ b/post_proc/virtualizer.c
@@ -56,6 +56,15 @@
ALOGV("%s: ctxt %p, strength: %d", __func__, context, strength);
context->strength = strength;
+ /*
+ * Zero strength is not equivalent to disable state as down mix
+ * is still happening for multichannel inputs.
+ * For better user experience, explicitly disable virtualizer module
+ * when strength is 0.
+ */
+ offload_virtualizer_set_enable_flag(&(context->offload_virt),
+ ((strength > 0) && !(context->temp_disabled)) ?
+ true : false);
offload_virtualizer_set_strength(&(context->offload_virt), strength);
if (context->ctl)
offload_virtualizer_send_params(context->ctl, &context->offload_virt,