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

Commit 2c880dde authored by Abhishek Arya's avatar Abhishek Arya Committed by Android (Google) Code Review
Browse files

Merge "Sanity check padding/delay values for gapless playback" into klp-dev

parents 6ae815e0 ba6093a4
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -25,6 +25,13 @@
namespace android {

SkipCutBuffer::SkipCutBuffer(int32_t skip, int32_t cut) {

    if (skip < 0 || cut < 0 || cut > 64 * 1024) {
        ALOGW("out of range skip/cut: %d/%d, using passthrough instead", skip, cut);
        skip = 0;
        cut = 0;
    }

    mFrontPadding = skip;
    mBackPadding = cut;
    mWriteHead = 0;