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

Commit 1211dd9b authored by Glenn Kasten's avatar Glenn Kasten Committed by Android (Google) Code Review
Browse files

Merge "Simplify error handling after track creation"

parents 1fe1f06d c08d20b6
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -482,10 +482,12 @@ status_t AudioRecord::openRecord_l(size_t epoch)
    ALOGE_IF(originalSessionId != AUDIO_SESSION_ALLOCATE && mSessionId != originalSessionId,
            "session ID changed from %d to %d", originalSessionId, mSessionId);

    if (record == 0 || status != NO_ERROR) {
    if (status != NO_ERROR) {
        ALOGE("AudioFlinger could not create record track, status: %d", status);
        goto release;
    }
    ALOG_ASSERT(record != 0);

    // AudioFlinger now owns the reference to the I/O handle,
    // so we are no longer responsible for releasing it.

+3 −1
Original line number Diff line number Diff line
@@ -1016,10 +1016,12 @@ status_t AudioTrack::createTrack_l(size_t epoch)
                                                      mClientUid,
                                                      &status);

    if (track == 0) {
    if (status != NO_ERROR) {
        ALOGE("AudioFlinger could not create track, status: %d", status);
        goto release;
    }
    ALOG_ASSERT(track != 0);

    // AudioFlinger now owns the reference to the I/O handle,
    // so we are no longer responsible for releasing it.