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

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

Merge " audio: Update error number in HAL"

parents d532e710 834b22f5
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -1746,6 +1746,8 @@ static ssize_t out_write(struct audio_stream_out *stream, const void *buffer,
        }

        ret = compress_write(out->compr, buffer, bytes);
        if (ret < 0)
            ret = -errno;
        ALOGVV("%s: writing buffer (%d bytes) to compress device returned %d", __func__, bytes, ret);
        if (ret >= 0 && ret < (ssize_t)bytes) {
            send_offload_cmd_l(out, OFFLOAD_CMD_WAIT_FOR_BUFFER);
@@ -1772,7 +1774,9 @@ static ssize_t out_write(struct audio_stream_out *stream, const void *buffer,
                ret = pcm_mmap_write(out->pcm, (void *)buffer, bytes);
            else
                ret = pcm_write(out->pcm, (void *)buffer, bytes);
            if (ret == 0)
            if (ret < 0)
                ret = -errno;
            else if (ret == 0)
                out->written += bytes / (out->config.channels * sizeof(short));
        }
    }
@@ -1814,6 +1818,8 @@ static int out_get_render_position(const struct audio_stream_out *stream,
        if (out->compr != NULL) {
            ret = compress_get_tstamp(out->compr, (unsigned long *)dsp_frames,
                    &out->sample_rate);
            if (ret < 0)
                ret = -errno;
            ALOGVV("%s rendered frames %d sample_rate %d",
                   __func__, *dsp_frames, out->sample_rate);
        }
@@ -2188,6 +2194,8 @@ static ssize_t in_read(struct audio_stream_in *stream, void *buffer,
            ret = pcm_mmap_read(in->pcm, buffer, bytes);
        else
            ret = pcm_read(in->pcm, buffer, bytes);
        if (ret < 0)
            ret = -errno;
    }

    /*