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

Commit 2d94235a authored by James Dong's avatar James Dong
Browse files

The presence of the kKeyAACProfile is optional, we should not mandate its presence in AACWriter.

o related-to-bug: 6421833

Change-Id: Ia1d75e73270430177d3010e8024b48c88eb7b430
parent 2c3297ab
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -98,9 +98,13 @@ status_t AACWriter::addSource(const sp<MediaSource> &source) {
    CHECK(!strcasecmp(mime, MEDIA_MIMETYPE_AUDIO_AAC));
    CHECK(meta->findInt32(kKeyChannelCount, &mChannelCount));
    CHECK(meta->findInt32(kKeySampleRate, &mSampleRate));
    CHECK(meta->findInt32(kKeyAACProfile, &mAACProfile));
    CHECK(mChannelCount >= 1 && mChannelCount <= 2);

    // Optionally, we want to check whether AACProfile is also set.
    if (meta->findInt32(kKeyAACProfile, &mAACProfile)) {
        ALOGI("AAC profile is changed to %d", mAACProfile);
    }

    mSource = source;
    return OK;
}