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

Commit 170a4287 authored by Yuchen Liu's avatar Yuchen Liu Committed by Android (Google) Code Review
Browse files

Merge "Add flag DIRECT to track flags for track running on DirectOutputThread"

parents c57567e2 c9c49cdf
Loading
Loading
Loading
Loading
+11 −1
Original line number Original line Diff line number Diff line
@@ -2356,10 +2356,20 @@ sp<AudioFlinger::PlaybackThread::Track> AudioFlinger::PlaybackThread::createTrac
            }
            }
        }
        }


        // Set DIRECT flag if current thread is DirectOutputThread. This can
        // happen when the playback is rerouted to direct output thread by
        // dynamic audio policy.
        // Do NOT report the flag changes back to client, since the client
        // doesn't explicitly request a direct flag.
        audio_output_flags_t trackFlags = *flags;
        if (mType == DIRECT) {
            trackFlags = static_cast<audio_output_flags_t>(trackFlags | AUDIO_OUTPUT_FLAG_DIRECT);
        }

        track = new Track(this, client, streamType, attr, sampleRate, format,
        track = new Track(this, client, streamType, attr, sampleRate, format,
                          channelMask, frameCount,
                          channelMask, frameCount,
                          nullptr /* buffer */, (size_t)0 /* bufferSize */, sharedBuffer,
                          nullptr /* buffer */, (size_t)0 /* bufferSize */, sharedBuffer,
                          sessionId, creatorPid, uid, *flags, TrackBase::TYPE_DEFAULT, portId);
                          sessionId, creatorPid, uid, trackFlags, TrackBase::TYPE_DEFAULT, portId);


        lStatus = track != 0 ? track->initCheck() : (status_t) NO_MEMORY;
        lStatus = track != 0 ? track->initCheck() : (status_t) NO_MEMORY;
        if (lStatus != NO_ERROR) {
        if (lStatus != NO_ERROR) {