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

Commit 9a1c8892 authored by Andy Hung's avatar Andy Hung
Browse files

Fix getTimestamp if offload thread is not initialized.

Returns INVALID_OPERATION.

Bug: 18605649
Change-Id: I440fb687fbf9249098e049982fa83bcd1515fd80
parent ab05b4cc
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -2688,7 +2688,8 @@ status_t AudioFlinger::PlaybackThread::getTimestamp_l(AudioTimestamp& timestamp)
    if (mNormalSink != 0) {
    if (mNormalSink != 0) {
        return mNormalSink->getTimestamp(timestamp);
        return mNormalSink->getTimestamp(timestamp);
    }
    }
    if ((mType == OFFLOAD || mType == DIRECT) && mOutput->stream->get_presentation_position) {
    if ((mType == OFFLOAD || mType == DIRECT)
            && mOutput != NULL && mOutput->stream->get_presentation_position) {
        uint64_t position64;
        uint64_t position64;
        int ret = mOutput->stream->get_presentation_position(
        int ret = mOutput->stream->get_presentation_position(
                                                mOutput->stream, &position64, &timestamp.mTime);
                                                mOutput->stream, &position64, &timestamp.mTime);