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

Commit 547e4156 authored by Weiyin Jiang's avatar Weiyin Jiang Committed by Gerrit - the friendly Code Review server
Browse files

audio: always reset out written regardless of offload_state

Pcm offload use case relies on written count to return render position.
For pcm offload looping playback, if out written is not reset during
out_flush, the 2nd playback will get a wrong render position at the
beginning.

Change-Id: I61f5369458838d14e07aaf14ddb195c4d41d8409
CRs-Fixed: 2107254
parent 0db83479
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -4263,10 +4263,10 @@ static int out_flush(struct audio_stream_out* stream)
        lock_output_stream(out);
        if (out->offload_state == OFFLOAD_STATE_PAUSED) {
            stop_compressed_output_l(out);
            out->written = 0;
        } else {
            ALOGW("%s called in invalid state %d", __func__, out->offload_state);
        }
        out->written = 0;
        pthread_mutex_unlock(&out->lock);
        ALOGD("copl(%p):out of compress flush", out);
        return 0;