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

Commit 75cfd5b8 authored by Gloria Wang's avatar Gloria Wang
Browse files

Do not change the number of bytes while converting 8-bit samples to 16-bit,

because this number will be used later to calculate mCurrentPos.
Fix for bug 5063703.

Change-Id: I75a78ef694482aa426d82a6c5f3d2ce570a9c19e
parent ae5df05f
Loading
Loading
Loading
Loading
+3 −1
Original line number Original line Diff line number Diff line
@@ -370,7 +370,9 @@ status_t WAVSource::read(


            int16_t *dst = (int16_t *)tmp->data();
            int16_t *dst = (int16_t *)tmp->data();
            const uint8_t *src = (const uint8_t *)buffer->data();
            const uint8_t *src = (const uint8_t *)buffer->data();
            while (n-- > 0) {
            ssize_t numBytes = n;

            while (numBytes-- > 0) {
                *dst++ = ((int16_t)(*src) - 128) * 256;
                *dst++ = ((int16_t)(*src) - 128) * 256;
                ++src;
                ++src;
            }
            }