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

Commit 672001ff authored by Manish Dewangan's avatar Manish Dewangan Committed by Garmond Leung
Browse files

audio: hal: Fix for passthrough playback issue.

-ip handler is getting triggered for dolby passthrough streams
 as audio_extn_passthru_is_direct_passthrough() is always returning false
 due to incorrect condition check.
-Added valid condition check for checking direct passthorugh.

Change-Id: Ieb0858b18ef7189ada8b263a8842576434902422
parent 2e6f6244
Loading
Loading
Loading
Loading
+9 −16
Original line number Diff line number Diff line
@@ -417,22 +417,6 @@ void audio_extn_passthru_update_stream_configuration(

}

bool audio_extn_passthru_is_direct_passthrough(struct stream_out *out)
{
    //check passthrough system property
    if (!property_get_bool("audio.offload.passthrough", false)) {
        return false;
    }

    if ((out != NULL) &&
        (out->compr_config.codec != NULL) &&
        (out->compr_config.codec->compr_passthr == PASSTHROUGH ||
         out->compr_config.codec->compr_passthr == PASSTHROUGH_IEC61937))
        return true;
    else
        return false;
}

bool audio_extn_passthru_is_passthrough_stream(struct stream_out *out)
{
    //check passthrough system property
@@ -467,6 +451,15 @@ bool audio_extn_passthru_is_passthrough_stream(struct stream_out *out)
    return false;
}

bool audio_extn_passthru_is_direct_passthrough(struct stream_out *out)
{
    if (((out != NULL) && audio_extn_passthru_is_passthrough_stream(out)) &&
          !audio_extn_passthru_is_convert_supported(out->dev, out))
        return true;
    else
        return false;
}

int audio_extn_passthru_get_buffer_size(audio_offload_info_t* info)
{
    uint32_t fragment_size = MIN_COMPRESS_PASSTHROUGH_FRAGMENT_SIZE;
+3 −3
Original line number Diff line number Diff line
@@ -3733,9 +3733,9 @@ static ssize_t out_write(struct audio_stream_out *stream, const void *buffer,
    }

    if (out->devices & AUDIO_DEVICE_OUT_AUX_DIGITAL) {
        /*ADD audio_extn_passthru_is_passthrough_stream(out) check*/
        if ((audio_extn_passthru_is_enabled()) &&
                (!out->is_iec61937_info_available)) {
        if (audio_extn_passthru_is_enabled() &&
            !out->is_iec61937_info_available &&
            audio_extn_passthru_is_passthrough_stream(out)) {
            audio_extn_passthru_update_stream_configuration(adev, out,
                    buffer, bytes);
            out->is_iec61937_info_available = true;