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

Commit b388e531 authored by Eric Laurent's avatar Eric Laurent
Browse files

Fix ALOG_ASSERT in AudioFlinger

Fix broken ALOG_ASSERT in updateFramesPendingAfterTrim_l() introduced by
commit 1c345196.

Change-Id: Ie1b2653069283f23ff0367f2628828e37fb0749c
parent fbe308d4
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -4045,11 +4045,11 @@ void AudioFlinger::PlaybackThread::TimedTrack::updateFramesPendingAfterTrim_l(
    uint32_t bufBytes        = buf.buffer()->size();
    uint32_t consumedAlready = buf.position();

    ALOG_ASSERT(consumedAlready <= bufFrames,
    ALOG_ASSERT(consumedAlready <= bufBytes,
                "Bad bookkeeping while updating frames pending.  Timed buffer is"
                " only %u bytes long, but claims to have consumed %u"
                " bytes.  (update reason: \"%s\")",
                bufFrames, consumedAlready, logTag);
                bufBytes, consumedAlready, logTag);

    uint32_t bufFrames = (bufBytes - consumedAlready) / mCblk->frameSize;
    ALOG_ASSERT(mFramesPendingInQueue >= bufFrames,