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

Commit d1dfcf84 authored by Harish Mahendrakar's avatar Harish Mahendrakar Committed by Andy Hung
Browse files

lvm wrapper: Set SourceFormat as per number of channels

Bug: 171585865
Test: poc in bug
Test: AudioEffectTest, AudioPreProcessingTest, BassBoostTest
Test: EnvReverbTest, EqualizerTest, LoudnessEnhancerTest
Test: PresetReverbTest, VirtualizerTest, VisualizerTest
Change-Id: I9bcf11110c0da052b6a142289570da40a6f409d1
parent 577e477d
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -1021,6 +1021,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")