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

Commit 408a3da9 authored by Bryan Ferris's avatar Bryan Ferris Committed by android-build-merger
Browse files

Merge "RESTRICT AUTOMERGE: aaudio: Fix converting negative FIFO counters to index" into pi-dev

am: 88a68930

Change-Id: Ic29823c6acf3c6857c632c815e1b4f50b77762f9
parents 98d75e7d 88a68930
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -38,7 +38,7 @@ fifo_frames_t FifoControllerBase::getFullFramesAvailable() {

fifo_frames_t FifoControllerBase::getReadIndex() {
    // % works with non-power of two sizes
    return (fifo_frames_t) (getReadCounter() % mCapacity);
    return (fifo_frames_t) ((uint64_t)getReadCounter() % mCapacity);
}

void FifoControllerBase::advanceReadIndex(fifo_frames_t numFrames) {
@@ -51,7 +51,7 @@ fifo_frames_t FifoControllerBase::getEmptyFramesAvailable() {

fifo_frames_t FifoControllerBase::getWriteIndex() {
    // % works with non-power of two sizes
    return (fifo_frames_t) (getWriteCounter() % mCapacity);
    return (fifo_frames_t) ((uint64_t)getWriteCounter() % mCapacity);
}

void FifoControllerBase::advanceWriteIndex(fifo_frames_t numFrames) {