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

Commit fd02a2fb authored by Ben Romberger's avatar Ben Romberger
Browse files

hal: Fix compressed offload SSR resume

Change sequence order in out_on_error so that the
stream is put into out standby before the offload
error callback is sent. This ensures that the
offload thread isn't blocked by out_standby handling.

Change-Id: Ibd1b73c7a995681b1d1ae4e79cef49d7cc658bb8
CRs-Fixed: 2297495
parent a8047642
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -3542,6 +3542,7 @@ static int out_standby(struct audio_stream *stream)
static int out_on_error(struct audio_stream *stream)
{
    struct stream_out *out = (struct stream_out *)stream;
    int status = 0;

    lock_output_stream(out);
    // always send CMD_ERROR for offload streams, this
@@ -3549,11 +3550,18 @@ static int out_on_error(struct audio_stream *stream)
    // since the stream is active, offload_callback_thread is also active.
    if (out->flags & AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD) {
        stop_compressed_output_l(out);
    }
    pthread_mutex_unlock(&out->lock);

    status = out_standby(&out->stream.common);

    lock_output_stream(out);
    if (out->flags & AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD) {
        send_offload_cmd_l(out, OFFLOAD_CMD_ERROR);
    }
    pthread_mutex_unlock(&out->lock);

    return out_standby(&out->stream.common);
    return status;
}

/*