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

Commit ec26dd12 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "audio: add support to return unreleased frames" into av-aosp.lnx.2.0-dev

parents f65ac945 35cbc3d5
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -100,6 +100,7 @@ size_t AudioResamplerQTI::resample(int32_t* out, size_t outFrameCount,

            if (frameIndex >= mBuffer.frameCount) {
                provider->releaseBuffer(&mBuffer);
                mInputIndex = 0;
            }
        }

@@ -126,6 +127,7 @@ size_t AudioResamplerQTI::resample(int32_t* out, size_t outFrameCount,
            pBuf[index++] = clampq4_27_from_float(*((float *)mBuffer.raw + frameIndex++));
            if (frameIndex >= mBuffer.frameCount * 2) {
                provider->releaseBuffer(&mBuffer);
                mInputIndex = 0;
            }
       }

@@ -142,6 +144,10 @@ resample_exit:
        fout[i+1] += float_from_q4_27((int32_t)(tempR>>12));
    }

    // save the unreleased frame count to mInputIndex
    if (mBuffer.frameCount) {
        mInputIndex = mChannelCount == 1 ? frameIndex : frameIndex/2;
    }
    mFrameIndex = frameIndex;
    return index;
}