ASoC: msm: qdsp6v2: fix crash during flac superset clip playback

During playback of a particular superset flac clip in repeat mode,
the target crashes when random seek operations are done after a
gapless switch. This is because DSP acks EOS earlier than
expected due to which gapless_transition flag is always set during
playback of the second stream. As a result, flush commands are not
issued to DSP causing the decoder to go into a bad state that leads
to a crash.

Set gapless_transition flag only if EOS has not been acknowledged yet.

CRs-Fixed: 1045100
Change-Id: I71af0e13b77ecf53a1b337e3fb2f7a82a2ce25af
Signed-off-by: Satya Krishna Pindiproli <satyak@codeaurora.org>
This commit is contained in:
Satya Krishna Pindiproli 2016-08-09 17:02:20 +05:30 committed by Gerrit - the friendly Code Review server
parent fa0dc60444
commit 23c544c4c9

View file

@ -1740,7 +1740,12 @@ static int msm_compr_trigger(struct snd_compr_stream *cstream, int cmd)
prtd->app_pointer = 0;
prtd->first_buffer = 1;
prtd->last_buffer = 0;
prtd->gapless_state.gapless_transition = 1;
/*
* Set gapless transition flag only if EOS hasn't been
* acknowledged already.
*/
if (atomic_read(&prtd->eos))
prtd->gapless_state.gapless_transition = 1;
prtd->marker_timestamp = 0;
/*