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

Commit ac5b003e authored by Neelkamal Semwal's avatar Neelkamal Semwal Committed by Ray Essick
Browse files

mp3dec: Changes in the fillMainDataBuf function

Test: atest CtsMediaV2TestCases:CodecDecoderTest
Test: atest VtsHalMediaC2V1_0TargetAudioDecTest

Bug: 173473906

Change-Id: I97857139ecb5341bb8f069c447d8d5af33390799
parent 1dff892a
Loading
Loading
Loading
Loading
+4 −17
Original line number Diff line number Diff line
@@ -598,18 +598,10 @@ void fillMainDataBuf(void *pMem, int32 temp)
        }
        else
        {
            int32 tmp1 = *(ptr++);
            for (int32 nBytes = temp >> 1; nBytes != 0; nBytes--)  /* read main data. */
            for (int32 nBytes = temp; nBytes != 0; nBytes--)  /* read main data. */
            {
                int32 tmp2 = *(ptr++);
                fillDataBuf(&pVars->mainDataStream, tmp1);
                fillDataBuf(&pVars->mainDataStream, tmp2);
                tmp1 = *(ptr++);
            }

            if (temp&1)
            {
                fillDataBuf(&pVars->mainDataStream, tmp1);
                int32 tmp = *(ptr++);
                fillDataBuf(&pVars->mainDataStream, tmp);
            }

            /* adjust circular buffer counter */
@@ -618,14 +610,9 @@ void fillMainDataBuf(void *pMem, int32 temp)
    }
    else
    {
        for (int32 nBytes = temp >> 1; nBytes != 0; nBytes--)  /* read main data. */
        for (int32 nBytes = temp; nBytes != 0; nBytes--)  /* read main data. */
        {
            fillDataBuf(&pVars->mainDataStream, *(pVars->inputStream.pBuffer + module(offset++  , BUFSIZE)));
            fillDataBuf(&pVars->mainDataStream, *(pVars->inputStream.pBuffer + module(offset++  , BUFSIZE)));
        }
        if (temp&1)
        {
            fillDataBuf(&pVars->mainDataStream, *(pVars->inputStream.pBuffer + module(offset  , BUFSIZE)));
        }
    }