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

Commit f49b5150 authored by Wei Jia's avatar Wei Jia Committed by Android (Google) Code Review
Browse files

Merge "AudioSink: use flags granted by AudioTrack, instead of the requested flags." into mnc-dev

parents 98459167 0162d00a
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -1679,7 +1679,7 @@ status_t MediaPlayerService::AudioOutput::open(
    t->setVolume(mLeftVolume, mRightVolume);

    mSampleRateHz = sampleRate;
    mFlags = flags;
    mFlags = t->getFlags(); // we suggest the flags above, but new AudioTrack() may not grant it.
    mMsecsPerFrame = 1E3f / (mPlaybackRate.mSpeed * sampleRate);
    uint32_t pos;
    if (t->getPosition(&pos) == OK) {
@@ -1688,7 +1688,9 @@ status_t MediaPlayerService::AudioOutput::open(
    mTrack = t;

    status_t res = NO_ERROR;
    if ((flags & AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD) == 0) {
    // Note some output devices may give us a direct track even though we don't specify it.
    // Example: Line application b/17459982.
    if ((mFlags & (AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD | AUDIO_OUTPUT_FLAG_DIRECT)) == 0) {
        res = t->setPlaybackRate(mPlaybackRate);
        if (res == NO_ERROR) {
            t->setAuxEffectSendLevel(mSendLevel);