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

Commit 0c937b49 authored by Eric Laurent's avatar Eric Laurent Committed by Android Git Automerger
Browse files

am eb16bb5d: am 7028a2c8: am 7e92abea: audioflinger: fix offload write buffer offset

* commit 'eb16bb5d':
  audioflinger: fix offload write buffer offset
parents 57f87026 eb16bb5d
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1917,7 +1917,7 @@ ssize_t AudioFlinger::PlaybackThread::threadLoop_write()
    // otherwise use the HAL / AudioStreamOut directly
    } else {
        // Direct output and offload threads
        size_t offset = (mCurrentWriteLength - mBytesRemaining) / sizeof(int16_t);
        size_t offset = (mCurrentWriteLength - mBytesRemaining);
        if (mUseAsyncWrite) {
            ALOGW_IF(mWriteAckSequence & 1, "threadLoop_write(): out of sequence write request");
            mWriteAckSequence += 2;
@@ -1928,7 +1928,7 @@ ssize_t AudioFlinger::PlaybackThread::threadLoop_write()
        // FIXME We should have an implementation of timestamps for direct output threads.
        // They are used e.g for multichannel PCM playback over HDMI.
        bytesWritten = mOutput->stream->write(mOutput->stream,
                                                   mMixBuffer + offset, mBytesRemaining);
                                                   (char *)mMixBuffer + offset, mBytesRemaining);
        if (mUseAsyncWrite &&
                ((bytesWritten < 0) || (bytesWritten == (ssize_t)mBytesRemaining))) {
            // do not wait for async callback in case of error of full write