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

Commit 4d58d4d8 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "aaudio: Fix converting negative FIFO counters to index"

parents 989a1cc0 58f7ff57
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -38,7 +38,7 @@ fifo_frames_t FifoControllerBase::getFullFramesAvailable() {


fifo_frames_t FifoControllerBase::getReadIndex() {
fifo_frames_t FifoControllerBase::getReadIndex() {
    // % works with non-power of two sizes
    // % 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) {
void FifoControllerBase::advanceReadIndex(fifo_frames_t numFrames) {
@@ -51,7 +51,7 @@ fifo_frames_t FifoControllerBase::getEmptyFramesAvailable() {


fifo_frames_t FifoControllerBase::getWriteIndex() {
fifo_frames_t FifoControllerBase::getWriteIndex() {
    // % works with non-power of two sizes
    // % 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) {
void FifoControllerBase::advanceWriteIndex(fifo_frames_t numFrames) {