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

Commit 323a75e1 authored by Dhanalakshmi Siddani's avatar Dhanalakshmi Siddani
Browse files

audio: Fix for clip skip issue during SSR

- Specific AAC clips are skipped to next clip on triggering SSR
- When SSR is triggered while track is waiting for stream end event for
  low bit rate clips, drain is unblocked and playback is switched to
  next track
- Fix is not to post drain ready event during SSR as actual stream end
  is not reached with more compressed data buffered to DSP

  CRs-Fixed: 766541

Change-Id: Id1573160001a2a252dc6613b58f70233e77cc3b4
parent d700078f
Loading
Loading
Loading
Loading
+11 −4
Original line number Diff line number Diff line
@@ -1172,15 +1172,22 @@ static void *offload_thread_loop(void *context)
            ret = compress_next_track(out->compr);
            if(ret == 0) {
                ALOGD("copl(%p):calling compress_partial_drain", out);
                compress_partial_drain(out->compr);
                ret = compress_partial_drain(out->compr);
                ALOGD("copl(%p):out of compress_partial_drain", out);
                if (ret < 0)
                    ret = -errno;
            }
            else if (ret == -ETIMEDOUT)
                compress_drain(out->compr);
            else
                ALOGE("%s: Next track returned error %d",__func__, ret);

            if (ret != -ENETRESET) {
                send_callback = true;
                event = STREAM_CBK_EVENT_DRAIN_READY;
                ALOGV("copl(%p):send drain callback, ret %d", out, ret);
            } else
                ALOGE("%s: Block drain ready event during SSR", __func__);
            break;
        case OFFLOAD_CMD_DRAIN:
            ALOGD("copl(%p):calling compress_drain", out);