diff options
| author | Ben Romberger <bromberg@codeaurora.org> | 2016-05-18 14:13:19 -0700 |
|---|---|---|
| committer | Kyle Yan <kyan@codeaurora.org> | 2016-06-22 14:46:11 -0700 |
| commit | 71cfed4142aca0cb5f49a50a4acf7045f32853b8 (patch) | |
| tree | c1ab51a90c2f681970b6c2b34d5d3492f80b0f09 | |
| parent | afedb5502b9ab1c82cd0087a1b7bbe47c0ccc7de (diff) | |
Asoc: msm: qdsp6v2: Track compress stream open properly
Set the stream open flag immediately after the
stream is opened to ensure correct closure of
the stream if there is an error condition.
Change-Id: I61faf6ddf99ab504e492a4e37d577b67acf99f09
Signed-off-by: Ben Romberger <bromberg@codeaurora.org>
| -rwxr-xr-x | sound/soc/msm/qdsp6v2/msm-compress-q6-v2.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/sound/soc/msm/qdsp6v2/msm-compress-q6-v2.c b/sound/soc/msm/qdsp6v2/msm-compress-q6-v2.c index 76fee74a5c6b..5a0de63e806e 100755 --- a/sound/soc/msm/qdsp6v2/msm-compress-q6-v2.c +++ b/sound/soc/msm/qdsp6v2/msm-compress-q6-v2.c @@ -942,6 +942,12 @@ static int msm_compr_configure_dsp(struct snd_compr_stream *cstream) }; pr_debug("%s: stream_id %d\n", __func__, ac->stream_id); + stream_index = STREAM_ARRAY_INDEX(ac->stream_id); + if (stream_index >= MAX_NUMBER_OF_STREAMS || stream_index < 0) { + pr_err("%s: Invalid stream index:%d", __func__, stream_index); + return -EINVAL; + } + if (prtd->codec_param.codec.format == SNDRV_PCM_FORMAT_S24_LE) bits_per_sample = 24; else if (prtd->codec_param.codec.format == SNDRV_PCM_FORMAT_S32_LE) @@ -955,6 +961,8 @@ static int msm_compr_configure_dsp(struct snd_compr_stream *cstream) __func__, ret, prtd->compr_passthr); return ret; } + prtd->gapless_state.stream_opened[stream_index] = 1; + ret = msm_pcm_routing_reg_phy_compr_stream( soc_prtd->dai_link->be_id, ac->perf_mode, @@ -978,6 +986,7 @@ static int msm_compr_configure_dsp(struct snd_compr_stream *cstream) __func__, ret, prtd->compr_passthr); return -ENOMEM; } + prtd->gapless_state.stream_opened[stream_index] = 1; pr_debug("%s: be_id %d\n", __func__, soc_prtd->dai_link->be_id); ret = msm_pcm_routing_reg_phy_stream(soc_prtd->dai_link->be_id, @@ -1017,13 +1026,7 @@ static int msm_compr_configure_dsp(struct snd_compr_stream *cstream) pr_err("%s: Set IO mode failed\n", __func__); return -EINVAL; } - stream_index = STREAM_ARRAY_INDEX(ac->stream_id); - if (stream_index >= MAX_NUMBER_OF_STREAMS || stream_index < 0) { - pr_err("%s: Invalid stream index:%d", __func__, stream_index); - return -EINVAL; - } - prtd->gapless_state.stream_opened[stream_index] = 1; runtime->fragments = prtd->codec_param.buffer.fragments; runtime->fragment_size = prtd->codec_param.buffer.fragment_size; pr_debug("allocate %d buffers each of size %d\n", |
