diff mbox

[v5,4/5] ASoC: compress: Prevent multicodec for compressed stream

Message ID 1404490075-24997-5-git-send-email-bcousson@baylibre.com (mailing list archive)
State Accepted
Commit 8151d5e60232d31f35e04f4e49a5b0d98b00a737
Headers show

Commit Message

Benoit Cousson July 4, 2014, 4:07 p.m. UTC
Multiple codecs does not make sense in the case of compressed
stream.

Exit with error if it happens.

Signed-off-by: Benoit Cousson <bcousson@baylibre.com>
Cc: Vinod Koul <vinod.koul@intel.com>
---
 sound/soc/soc-compress.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Vinod Koul July 7, 2014, 8:50 a.m. UTC | #1
On Fri, Jul 04, 2014 at 06:07:54PM +0200, Benoit Cousson wrote:
> Multiple codecs does not make sense in the case of compressed
> stream.
> 
> Exit with error if it happens.

Acked-by: Vinod Koul <vinod.koul@intel.com>
diff mbox

Patch

diff --git a/sound/soc/soc-compress.c b/sound/soc/soc-compress.c
index f96fb96..27c06ac 100644
--- a/sound/soc/soc-compress.c
+++ b/sound/soc/soc-compress.c
@@ -629,6 +629,11 @@  int soc_new_compress(struct snd_soc_pcm_runtime *rtd, int num)
 	char new_name[64];
 	int ret = 0, direction = 0;
 
+	if (rtd->num_codecs > 1) {
+		dev_err(rtd->card->dev, "Multicodec not supported for compressed stream\n");
+		return -EINVAL;
+	}
+
 	/* check client and interface hw capabilities */
 	snprintf(new_name, sizeof(new_name), "%s %s-%d",
 			rtd->dai_link->stream_name, codec_dai->name, num);