Browse Source

Merge "dsp: codecs: add support to enable multiaac 5.1 channel playback"

Linux Build Service Account 7 years ago
parent
commit
b4e447d3e0
1 changed files with 8 additions and 1 deletions
  1. 8 1
      dsp/codecs/audio_multi_aac.c

+ 8 - 1
dsp/codecs/audio_multi_aac.c

@@ -111,7 +111,14 @@ static long audio_ioctl_shared(struct file *file, unsigned int cmd,
 			pr_err("cmd media format block failed\n");
 			break;
 		}
-		rc = q6asm_set_encdec_chan_map(audio->ac, 2);
+
+		/* Fall back to the default number of channels
+		 * if aac_cfg.ch_cfg is not between 1-6
+		 */
+		if ((aac_cfg.ch_cfg == 0) || (aac_cfg.ch_cfg > 6))
+			aac_cfg.ch_cfg = 2;
+
+		rc = q6asm_set_encdec_chan_map(audio->ac, aac_cfg.ch_cfg);
 		if (rc < 0) {
 			pr_err("%s: cmd set encdec_chan_map failed\n",
 				__func__);