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

Commit 9aee331b authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "hal: allow to get render position for non-offload use cases"

parents e003ce9e 32a556e3
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -2246,9 +2246,13 @@ static int out_get_render_position(const struct audio_stream_out *stream,
{
    struct stream_out *out = (struct stream_out *)stream;
    struct audio_device *adev = out->dev;
    if (is_offload_usecase(out->usecase) && (dsp_frames != NULL)) {
        ssize_t ret = 0;

    if (dsp_frames == NULL)
        return -EINVAL;

    *dsp_frames = 0;
    if (is_offload_usecase(out->usecase)) {
        ssize_t ret = 0;
        pthread_mutex_lock(&out->lock);
        if (out->compr != NULL) {
            ret = compress_get_tstamp(out->compr, (unsigned long *)dsp_frames,
@@ -2276,6 +2280,9 @@ static int out_get_render_position(const struct audio_stream_out *stream,
        } else {
            return 0;
        }
    } else if (audio_is_linear_pcm(out->format)) {
        *dsp_frames = out->written;
        return 0;
    } else
        return -EINVAL;
}