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

Commit 43bdc1de authored by Glenn Kasten's avatar Glenn Kasten
Browse files

Fix build after merge from AOSP

Change-Id: I1cd3432c02db1600e49ade67e6a89e39e7a8d3ed
parent 4b76d27d
Loading
Loading
Loading
Loading
+4 −8
Original line number Diff line number Diff line
@@ -871,24 +871,20 @@ status_t AudioTrack::createTrack_l(size_t epoch)

    // Client decides whether the track is TIMED (see below), but can only express a preference
    // for FAST.  Server will perform additional tests.
    if ((mFlags & AUDIO_OUTPUT_FLAG_FAST) && !(
    if ((mFlags & AUDIO_OUTPUT_FLAG_FAST) && !((
            // either of these use cases:
            // use case 1: shared buffer
            (mSharedBuffer != 0) ||
            // use case 2: callback handler
            (mCbf != NULL))) {
            (mCbf != NULL)) &&
            // matching sample rate
            (mSampleRate == afSampleRate))) {
        ALOGW("AUDIO_OUTPUT_FLAG_FAST denied by client");
        // once denied, do not request again if IAudioTrack is re-created
        mFlags = (audio_output_flags_t) (mFlags & ~AUDIO_OUTPUT_FLAG_FAST);
    }
    ALOGV("createTrack_l() output %d afLatency %d", output, afLatency);

    if ((flags & AUDIO_OUTPUT_FLAG_FAST) && sampleRate != afSampleRate) {
        ALOGW("AUDIO_OUTPUT_FLAG_FAST denied by client due to mismatching sample rate (%d vs %d)",
              sampleRate, afSampleRate);
        flags = (audio_output_flags_t) (flags & ~AUDIO_OUTPUT_FLAG_FAST);
    }

    // The client's AudioTrack buffer is divided into n parts for purpose of wakeup by server, where
    //  n = 1   fast track with single buffering; nBuffering is ignored
    //  n = 2   fast track with double buffering