Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 86f5ec9e authored by Harish Mahendrakar's avatar Harish Mahendrakar
Browse files

lvm wrapper: Set SourceFormat as per number of channels

Bug: 171585865
Test: poc in bug

Change-Id: I9bcf11110c0da052b6a142289570da40a6f409d1
Merged-In: I9bcf11110c0da052b6a142289570da40a6f409d1
(cherry picked from commit e820941572fb3796126f54d01535dc640bfa3636)
parent d90aeec7
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -982,6 +982,16 @@ int Effect_setConfig(EffectContext* pContext, effect_config_t* pConfig) {
        ActiveParams.NrChannels = NrChannels;
        ActiveParams.ChMask = pConfig->inputCfg.channels;

        if (NrChannels == 1) {
            ActiveParams.SourceFormat = LVM_MONO;
        } else if (NrChannels == 2) {
            ActiveParams.SourceFormat = LVM_STEREO;
        } else if (NrChannels > 2 && NrChannels <= LVM_MAX_CHANNELS) {
            ActiveParams.SourceFormat = LVM_MULTICHANNEL;
        } else {
            return -EINVAL;
        }

        LvmStatus = LVM_SetControlParameters(pContext->pBundledContext->hInstance, &ActiveParams);

        LVM_ERROR_CHECK(LvmStatus, "LVM_SetControlParameters", "Effect_setConfig")