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

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

Merge "audio: Set the correct audio format for ADTS"

parents 20655a06 daa708c5
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -1346,11 +1346,21 @@ static int parse_compress_metadata(struct stream_out *out, struct str_parms *par
    struct compr_gapless_mdata tmp_mdata;
    tmp_mdata.encoder_delay = 0;
    tmp_mdata.encoder_padding = 0;

    if (!out || !parms) {
        ALOGE("%s: return invalid ",__func__);
        return -EINVAL;
    }

    ret = str_parms_get_str(parms, AUDIO_OFFLOAD_CODEC_FORMAT, value, sizeof(value));
    if (ret >= 0) {
        if (atoi(value) == SND_AUDIOSTREAMFORMAT_MP4ADTS) {
            out->compr_config.codec->format = SND_AUDIOSTREAMFORMAT_MP4ADTS;
            ALOGV("ADTS format is set in offload mode");
        }
        out->send_new_metadata = 1;
    }

    ret = str_parms_get_str(parms, AUDIO_OFFLOAD_CODEC_SAMPLE_RATE, value, sizeof(value));
    if(ret >= 0)
        is_meta_data_params = true;
@@ -2176,6 +2186,7 @@ static int adev_open_output_stream(struct audio_hw_device *dev,
        out->compr_config.codec->ch_in =
                    popcount(config->channel_mask);
        out->compr_config.codec->ch_out = out->compr_config.codec->ch_in;
        out->compr_config.codec->format = SND_AUDIOSTREAMFORMAT_RAW;

        if (config->offload_info.format == AUDIO_FORMAT_PCM_16_BIT_OFFLOAD)
            out->compr_config.codec->format = SNDRV_PCM_FORMAT_S16_LE;